#include "camer_ops.h"
#include <signal.h>
#include <time.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>


extern int sensorId;
extern int displayId;
int frame = 0;
int startPlayAvi = 0;
int pausePlayAvi = 0;
char videoPath[50];
char h265Path[50];
extern int totalFrame;
extern int playFrame;
extern int decodeFrame;
extern int playFlag;
extern int decodeFlag;
extern int video_freeze_state;
extern int record;

//FICE及血管增强查找表，未使用
static const  unsigned int Array[256][256] = {
    {0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255},
    {0,64,147,192,216,228,236,241,244,246,248,249,250,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255},
    {0,19,65,111,148,175,194,207,217,224,229,234,237,239,241,243,245,246,247,248,248,249,249,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255},
    {0,9,33,65,97,126,149,168,183,195,204,212,218,223,227,230,233,236,238,239,241,242,243,244,245,246,247,247,248,248,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255},
    {0,5,20,41,66,90,113,133,150,165,177,187,196,203,209,215,219,223,226,229,231,233,235,237,238,240,241,242,243,244,245,245,246,246,247,247,248,248,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255},
    {0,3,13,28,46,66,86,105,122,138,151,163,174,183,190,197,203,208,213,217,220,223,226,228,230,232,234,235,237,238,239,240,241,242,243,244,244,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255},
    {0,2,9,20,34,50,67,83,100,115,129,141,153,163,172,180,187,193,198,203,208,212,215,218,221,224,226,228,230,232,233,235,236,237,238,239,240,241,242,242,243,244,244,245,245,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255},
    {0,1,7,15,26,39,53,67,82,96,109,122,133,144,154,162,170,178,184,190,195,200,204,208,211,214,217,220,222,224,226,228,230,231,233,234,235,236,237,238,239,240,241,242,242,243,243,244,244,245,245,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255},
    {0,1,5,11,20,31,42,55,68,80,93,105,116,127,137,146,155,163,170,176,182,187,192,197,201,205,208,211,214,217,219,221,223,225,227,228,230,231,233,234,235,236,237,238,239,239,240,241,242,242,243,243,244,244,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255},
    {0,1,4,9,16,25,35,45,57,68,80,91,102,112,122,132,140,148,156,163,169,175,181,186,190,195,198,202,205,208,211,214,216,218,221,222,224,226,227,229,230,232,233,234,235,236,237,238,238,239,240,240,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255},
    {0,0,3,7,13,20,29,38,48,58,69,79,89,99,109,118,127,135,143,150,157,163,169,175,180,184,189,193,197,200,203,206,209,212,214,216,218,220,222,224,225,227,228,229,231,232,233,234,235,236,237,237,238,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,2,6,11,17,24,32,41,50,60,69,79,88,97,106,115,123,131,138,145,152,158,164,169,174,179,184,188,191,195,198,201,204,207,210,212,214,216,218,220,222,223,225,226,228,229,230,231,232,233,234,235,236,237,237,238,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,2,5,9,14,21,28,35,43,52,61,70,79,87,96,104,112,120,128,135,141,148,154,159,165,170,174,179,183,187,190,194,197,200,203,206,208,210,213,215,217,218,220,222,223,225,226,227,228,230,231,232,233,234,235,235,236,237,238,238,239,240,240,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,2,4,8,12,18,24,31,38,46,54,62,70,78,87,95,102,110,117,125,131,138,144,150,155,160,165,170,174,179,183,186,190,193,196,199,202,204,207,209,211,213,215,217,219,220,222,223,225,226,227,228,229,230,231,232,233,234,235,236,236,237,238,238,239,240,240,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,1,4,7,11,15,21,27,33,40,48,55,63,71,78,86,94,101,108,115,122,128,135,141,146,152,157,162,166,171,175,179,182,186,189,192,195,198,201,203,206,208,210,212,214,216,217,219,220,222,223,225,226,227,228,229,230,231,232,233,234,235,235,236,237,237,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,1,3,6,9,13,18,24,30,36,43,50,57,64,71,78,86,93,100,107,113,120,126,132,138,143,148,153,158,163,167,171,175,179,182,186,189,192,195,197,200,202,205,207,209,211,213,215,216,218,219,221,222,223,225,226,227,228,229,230,231,232,233,234,234,235,236,237,237,238,238,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,1,3,5,8,12,16,21,26,32,38,45,51,58,65,72,79,85,92,99,105,112,118,124,130,135,140,146,150,155,160,164,168,172,176,179,182,186,189,191,194,197,199,202,204,206,208,210,212,214,215,217,218,220,221,223,224,225,226,227,228,229,230,231,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,1,2,4,7,11,14,19,24,29,34,40,46,53,59,66,72,79,85,92,98,104,110,116,122,127,133,138,143,148,152,157,161,165,169,173,176,179,183,186,189,191,194,196,199,201,203,205,207,209,211,213,215,216,218,219,220,222,223,224,225,226,227,228,229,230,231,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,1,2,4,6,9,13,17,21,26,31,37,42,48,54,60,66,73,79,85,91,97,103,109,115,120,126,131,136,141,145,150,154,158,162,166,170,173,177,180,183,186,189,191,194,196,199,201,203,205,207,209,211,212,214,215,217,218,220,221,222,223,225,226,227,228,229,230,230,231,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,2,3,6,8,12,15,19,24,28,33,39,44,50,55,61,67,73,79,85,91,97,102,108,113,119,124,129,134,139,143,148,152,156,160,164,167,171,174,177,180,183,186,189,191,194,196,198,201,203,205,207,208,210,212,213,215,216,218,219,220,222,223,224,225,226,227,228,229,230,231,231,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,2,3,5,8,11,14,17,21,26,30,35,40,46,51,57,62,68,74,79,85,91,96,102,107,112,118,123,127,132,137,141,146,150,154,158,161,165,168,172,175,178,181,184,186,189,191,194,196,198,200,202,204,206,208,210,211,213,214,216,217,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,3,5,7,10,13,16,20,24,28,32,37,42,47,52,58,63,69,74,80,85,90,96,101,106,111,116,121,126,131,135,139,144,148,152,156,159,163,166,169,173,176,179,181,184,187,189,192,194,196,198,200,202,204,206,208,209,211,213,214,215,217,218,219,221,222,223,224,225,226,227,228,229,230,230,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,3,4,6,9,11,15,18,22,26,30,34,39,44,49,54,59,64,69,75,80,85,90,96,101,106,111,115,120,125,129,134,138,142,146,150,154,157,161,164,167,171,174,177,179,182,185,187,190,192,194,196,198,200,202,204,206,208,209,211,212,214,215,217,218,219,220,221,223,224,225,226,227,228,228,229,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,2,4,6,8,10,13,17,20,24,28,32,36,41,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,119,124,128,132,136,140,144,148,152,155,159,162,166,169,172,175,177,180,183,185,188,190,192,194,197,199,200,202,204,206,208,209,211,212,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,230,231,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,2,3,5,7,10,12,15,18,22,26,29,34,38,42,47,51,56,61,66,71,76,81,85,90,95,100,105,109,114,118,123,127,131,135,139,143,147,150,154,157,161,164,167,170,173,176,178,181,183,186,188,190,193,195,197,199,201,202,204,206,208,209,211,212,213,215,216,217,219,220,221,222,223,224,225,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,2,3,5,7,9,11,14,17,20,24,27,31,35,39,44,48,53,57,62,67,71,76,81,86,90,95,100,104,109,113,117,122,126,130,134,138,142,145,149,152,156,159,162,165,168,171,174,177,179,182,184,187,189,191,193,195,197,199,201,203,204,206,208,209,211,212,213,215,216,217,218,220,221,222,223,224,225,226,227,228,228,229,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,2,3,4,6,8,10,13,16,19,22,26,29,33,37,41,45,49,54,58,63,67,72,77,81,86,90,95,99,104,108,113,117,121,125,129,133,137,140,144,148,151,154,158,161,164,167,170,172,175,178,180,183,185,187,189,192,194,196,198,199,201,203,205,206,208,209,211,212,213,215,216,217,218,220,221,222,223,224,225,226,227,227,228,229,230,231,231,232,233,233,234,235,235,236,236,237,238,238,239,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,2,3,4,6,8,10,12,15,18,21,24,27,31,35,38,42,47,51,55,59,64,68,73,77,82,86,91,95,99,104,108,112,116,120,124,128,132,136,139,143,146,150,153,156,159,162,165,168,171,174,176,179,181,183,186,188,190,192,194,196,198,200,201,203,205,206,208,209,211,212,214,215,216,217,218,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,1,1,2,4,5,7,9,11,14,16,19,22,25,29,32,36,40,44,48,52,56,60,65,69,73,78,82,86,91,95,99,103,108,112,116,120,124,127,131,135,138,142,145,149,152,155,158,161,164,167,170,172,175,177,180,182,184,187,189,191,193,195,197,198,200,202,203,205,207,208,210,211,212,214,215,216,217,218,220,221,222,223,224,225,225,226,227,228,229,230,230,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,242,243,243,244,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,2,3,5,7,8,11,13,15,18,21,24,27,30,34,38,41,45,49,53,57,61,66,70,74,78,82,87,91,95,99,103,107,111,115,119,123,127,130,134,137,141,144,148,151,154,157,160,163,166,168,171,173,176,178,181,183,185,187,189,191,193,195,197,199,201,202,204,205,207,208,210,211,212,214,215,216,217,219,220,221,222,223,224,225,225,226,227,228,229,230,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,2,3,5,6,8,10,12,14,17,20,22,25,29,32,35,39,43,46,50,54,58,62,66,70,75,79,83,87,91,95,99,103,107,111,115,119,122,126,130,133,137,140,143,147,150,153,156,159,162,164,167,170,172,175,177,179,182,184,186,188,190,192,194,196,198,199,201,203,204,206,207,209,210,211,213,214,215,216,218,219,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,2,3,4,6,7,9,11,13,16,18,21,24,27,30,33,37,40,44,48,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,114,118,122,125,129,132,136,139,142,146,149,152,155,158,160,163,166,169,171,174,176,178,181,183,185,187,189,191,193,195,197,198,200,202,203,205,206,208,209,210,212,213,214,215,217,218,219,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,2,3,4,5,7,9,11,13,15,17,20,23,26,29,32,35,38,42,45,49,53,56,60,64,68,72,76,80,84,88,91,95,99,103,107,111,114,118,121,125,128,132,135,138,142,145,148,151,154,157,160,162,165,167,170,172,175,177,179,182,184,186,188,190,192,194,195,197,199,201,202,204,205,207,208,209,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,2,3,4,5,6,8,10,12,14,16,19,21,24,27,30,33,36,40,43,47,50,54,57,61,65,69,73,76,80,84,88,92,95,99,103,107,110,114,118,121,125,128,131,135,138,141,144,147,150,153,156,159,161,164,167,169,171,174,176,178,181,183,185,187,189,191,193,194,196,198,200,201,203,204,206,207,208,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,1,2,3,5,6,8,9,11,13,15,18,20,23,26,28,31,34,38,41,44,48,51,55,58,62,66,69,73,77,81,84,88,92,96,99,103,107,110,114,117,121,124,127,131,134,137,140,143,146,149,152,155,158,160,163,166,168,171,173,175,177,180,182,184,186,188,190,192,193,195,197,199,200,202,203,205,206,208,209,210,212,213,214,215,216,217,218,220,221,221,222,223,224,225,226,227,228,228,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,1,2,3,4,6,7,9,11,13,15,17,19,22,24,27,30,33,36,39,42,45,49,52,56,59,63,67,70,74,78,81,85,89,92,96,99,103,107,110,114,117,120,124,127,130,134,137,140,143,146,149,151,154,157,160,162,165,167,170,172,174,177,179,181,183,185,187,189,191,192,194,196,198,199,201,202,204,205,207,208,209,211,212,213,214,216,217,218,219,220,221,222,223,224,224,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,1,2,3,4,5,7,8,10,12,14,16,18,21,23,26,28,31,34,37,40,43,47,50,53,57,60,64,67,71,74,78,82,85,89,92,96,100,103,107,110,113,117,120,123,127,130,133,136,139,142,145,148,151,154,156,159,161,164,166,169,171,173,176,178,180,182,184,186,188,190,192,193,195,197,198,200,202,203,204,206,207,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,1,2,3,4,5,6,8,9,11,13,15,17,19,22,24,27,30,32,35,38,41,45,48,51,54,58,61,65,68,72,75,79,82,86,89,93,96,100,103,107,110,113,117,120,123,126,130,133,136,139,142,145,147,150,153,156,158,161,163,166,168,170,173,175,177,179,181,183,185,187,189,191,193,194,196,198,199,201,202,204,205,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,238,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,1,1,2,3,4,5,6,7,9,11,12,14,16,19,21,23,26,28,31,34,37,40,43,46,49,52,55,59,62,65,69,72,76,79,83,86,90,93,97,100,103,107,110,113,117,120,123,126,129,132,135,138,141,144,147,150,152,155,158,160,163,165,167,170,172,174,176,178,180,182,184,186,188,190,192,194,195,197,198,200,201,203,204,206,207,208,210,211,212,213,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,2,3,3,5,6,7,8,10,12,14,16,18,20,22,24,27,30,32,35,38,41,44,47,50,53,56,60,63,66,70,73,76,80,83,87,90,93,97,100,103,107,110,113,117,120,123,126,129,132,135,138,141,144,146,149,152,154,157,159,162,164,167,169,171,173,176,178,180,182,184,186,187,189,191,193,194,196,198,199,201,202,204,205,206,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,232,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,242,243,243,244,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,2,2,3,4,5,7,8,10,11,13,15,17,19,21,23,26,28,31,33,36,39,42,45,48,51,54,57,61,64,67,70,74,77,80,84,87,90,94,97,100,104,107,110,113,116,120,123,126,129,132,135,138,140,143,146,149,151,154,156,159,161,164,166,168,171,173,175,177,179,181,183,185,187,189,190,192,194,195,197,199,200,202,203,204,206,207,208,210,211,212,213,214,216,217,218,219,220,221,222,223,223,224,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,238,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,3,4,5,6,8,9,11,12,14,16,18,20,22,25,27,29,32,35,37,40,43,46,49,52,55,58,61,65,68,71,74,78,81,84,87,91,94,97,101,104,107,110,113,116,120,123,126,129,131,134,137,140,143,146,148,151,153,156,158,161,163,165,168,170,172,174,176,178,180,182,184,186,188,190,191,193,195,196,198,199,201,202,204,205,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,3,4,5,6,7,9,10,12,13,15,17,19,21,24,26,28,31,33,36,39,41,44,47,50,53,56,59,62,65,69,72,75,78,81,85,88,91,94,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,142,145,148,150,153,155,158,160,163,165,167,169,172,174,176,178,180,182,184,186,187,189,191,193,194,196,197,199,200,202,203,205,206,207,209,210,211,212,213,214,216,217,218,219,220,221,222,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,3,4,5,6,7,8,10,11,13,15,16,18,20,22,25,27,29,32,34,37,40,42,45,48,51,54,57,60,63,66,69,73,76,79,82,85,88,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,139,142,145,147,150,153,155,157,160,162,164,167,169,171,173,175,177,179,181,183,185,187,189,190,192,194,195,197,198,200,201,203,204,205,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,3,3,4,5,7,8,9,11,12,14,16,18,19,22,24,26,28,31,33,36,38,41,44,46,49,52,55,58,61,64,67,70,73,76,79,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,139,142,145,147,150,152,155,157,159,162,164,166,168,171,173,175,177,179,181,183,184,186,188,190,191,193,195,196,198,199,201,202,204,205,206,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,2,3,4,5,6,7,9,10,12,13,15,17,19,21,23,25,27,29,32,34,37,39,42,45,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,99,102,105,108,111,114,117,119,122,125,128,131,134,136,139,142,144,147,149,152,154,157,159,161,164,166,168,170,172,174,176,178,180,182,184,186,187,189,191,193,194,196,197,199,200,202,203,204,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,2,3,4,5,6,7,8,10,11,13,14,16,18,20,22,24,26,28,30,33,35,38,40,43,46,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,122,125,128,131,133,136,139,141,144,147,149,152,154,156,159,161,163,165,168,170,172,174,176,178,180,182,183,185,187,189,190,192,194,195,197,198,200,201,203,204,205,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,238,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,1,1,2,2,3,4,5,6,7,8,9,11,12,14,15,17,19,21,23,25,27,29,32,34,36,39,41,44,47,49,52,55,58,61,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,122,125,128,131,133,136,139,141,144,146,149,151,154,156,158,161,163,165,167,169,171,173,175,177,179,181,183,185,187,188,190,192,193,195,196,198,199,201,202,204,205,206,207,209,210,211,212,213,214,216,217,218,219,220,221,221,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,3,4,4,5,7,8,9,10,12,13,15,16,18,20,22,24,26,28,30,33,35,37,40,42,45,48,50,53,56,59,61,64,67,70,73,76,79,82,85,88,91,94,97,100,102,105,108,111,114,117,120,122,125,128,131,133,136,139,141,144,146,149,151,153,156,158,160,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,191,193,194,196,197,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,3,3,4,5,6,7,9,10,11,13,14,16,17,19,21,23,25,27,29,31,34,36,39,41,43,46,49,51,54,57,59,62,65,68,71,74,77,79,82,85,88,91,94,97,100,103,106,109,111,114,117,120,123,125,128,131,133,136,138,141,144,146,148,151,153,156,158,160,162,164,167,169,171,173,175,177,179,180,182,184,186,187,189,191,192,194,196,197,199,200,201,203,204,205,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,223,224,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,3,3,4,5,6,7,8,9,11,12,14,15,17,19,20,22,24,26,28,30,33,35,37,40,42,44,47,50,52,55,58,60,63,66,69,71,74,77,80,83,86,89,92,94,97,100,103,106,109,112,114,117,120,123,125,128,131,133,136,138,141,143,146,148,151,153,155,158,160,162,164,166,168,170,172,174,176,178,180,182,184,185,187,189,190,192,194,195,197,198,200,201,202,204,205,206,208,209,210,211,212,213,215,216,217,218,219,220,221,221,222,223,224,225,226,226,227,228,229,229,230,231,232,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,2,3,4,5,6,7,8,9,10,12,13,15,16,18,20,21,23,25,27,29,31,34,36,38,41,43,45,48,51,53,56,58,61,64,67,69,72,75,78,81,84,86,89,92,95,98,101,103,106,109,112,115,117,120,123,125,128,131,133,136,138,141,143,146,148,150,153,155,157,160,162,164,166,168,170,172,174,176,178,180,182,183,185,187,188,190,192,193,195,196,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,2,3,4,5,5,6,8,9,10,11,13,14,16,17,19,21,22,24,26,28,30,32,35,37,39,42,44,46,49,51,54,57,59,62,65,67,70,73,76,78,81,84,87,90,93,95,98,101,104,107,109,112,115,117,120,123,125,128,131,133,136,138,141,143,146,148,150,153,155,157,159,162,164,166,168,170,172,174,176,178,179,181,183,185,186,188,190,191,193,195,196,197,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,2,3,4,4,5,6,7,8,10,11,12,14,15,17,18,20,22,23,25,27,29,31,33,36,38,40,43,45,47,50,52,55,58,60,63,65,68,71,74,76,79,82,85,87,90,93,96,99,101,104,107,110,112,115,118,120,123,126,128,131,133,136,138,141,143,146,148,150,153,155,157,159,161,164,166,168,170,172,174,175,177,179,181,183,185,186,188,190,191,193,194,196,197,199,200,201,203,204,205,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,2,2,3,3,4,5,6,7,8,9,10,12,13,14,16,17,19,21,23,24,26,28,30,32,34,37,39,41,44,46,48,51,53,56,58,61,64,66,69,72,74,77,80,82,85,88,91,93,96,99,102,104,107,110,113,115,118,121,123,126,128,131,133,136,138,141,143,146,148,150,152,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,189,191,192,194,195,197,198,200,201,203,204,205,206,208,209,210,211,212,213,214,216,217,218,219,220,220,221,222,223,224,225,226,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,1,2,3,3,4,5,6,7,8,9,10,11,13,14,15,17,18,20,22,24,25,27,29,31,33,35,38,40,42,44,47,49,52,54,57,59,62,64,67,70,72,75,78,80,83,86,89,91,94,97,99,102,105,107,110,113,115,118,121,123,126,128,131,133,136,138,141,143,145,148,150,152,155,157,159,161,163,165,167,169,171,173,175,177,179,181,182,184,186,187,189,191,192,194,195,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,1,2,3,3,4,5,6,6,7,8,10,11,12,13,15,16,18,19,21,23,25,26,28,30,32,34,36,39,41,43,45,48,50,53,55,57,60,63,65,68,70,73,76,78,81,84,86,89,92,94,97,100,102,105,108,110,113,116,118,121,123,126,129,131,134,136,138,141,143,145,148,150,152,155,157,159,161,163,165,167,169,171,173,175,177,179,180,182,184,186,187,189,190,192,193,195,196,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,228,229,230,231,231,232,233,233,234,234,235,236,236,237,237,238,238,239,239,240,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,1,1,1,2,2,3,4,4,5,6,7,8,9,10,12,13,14,16,17,19,20,22,24,26,27,29,31,33,35,37,40,42,44,46,49,51,53,56,58,61,63,66,68,71,74,76,79,82,84,87,90,92,95,98,100,103,106,108,111,113,116,119,121,124,126,129,131,134,136,138,141,143,145,148,150,152,154,157,159,161,163,165,167,169,171,173,175,177,178,180,182,184,185,187,189,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,2,2,3,4,4,5,6,7,8,9,10,11,12,14,15,17,18,20,21,23,25,26,28,30,32,34,36,38,40,43,45,47,50,52,54,57,59,62,64,67,69,72,74,77,80,82,85,87,90,93,95,98,101,103,106,108,111,114,116,119,121,124,126,129,131,134,136,139,141,143,146,148,150,152,154,157,159,161,163,165,167,169,171,173,175,176,178,180,182,183,185,187,188,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,238,238,239,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,2,2,3,3,4,5,6,7,8,9,10,11,12,13,15,16,17,19,21,22,24,26,27,29,31,33,35,37,39,41,44,46,48,50,53,55,58,60,62,65,67,70,72,75,78,80,83,85,88,91,93,96,98,101,104,106,109,111,114,117,119,122,124,127,129,131,134,136,139,141,143,146,148,150,152,154,157,159,161,163,165,167,169,171,173,174,176,178,180,182,183,185,187,188,190,191,193,194,196,197,199,200,202,203,204,205,207,208,209,210,211,212,214,215,216,217,218,219,220,221,221,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,2,2,3,3,4,5,6,6,7,8,9,10,12,13,14,15,17,18,20,21,23,25,27,28,30,32,34,36,38,40,42,45,47,49,51,54,56,58,61,63,66,68,71,73,76,78,81,83,86,89,91,94,96,99,101,104,107,109,112,114,117,119,122,124,127,129,132,134,136,139,141,143,146,148,150,152,154,157,159,161,163,165,167,169,171,173,174,176,178,180,182,183,185,187,188,190,191,193,194,196,197,199,200,201,203,204,205,206,208,209,210,211,212,213,215,216,217,218,219,220,220,221,222,223,224,225,226,226,227,228,229,229,230,231,232,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,14,15,16,18,19,21,22,24,26,27,29,31,33,35,37,39,41,43,45,48,50,52,54,57,59,62,64,66,69,71,74,76,79,81,84,87,89,92,94,97,99,102,104,107,110,112,115,117,120,122,125,127,129,132,134,137,139,141,143,146,148,150,152,154,157,159,161,163,165,167,169,171,172,174,176,178,180,181,183,185,186,188,190,191,193,194,196,197,198,200,201,203,204,205,206,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,1,2,2,3,4,4,5,6,7,8,9,10,11,12,13,14,16,17,19,20,22,23,25,27,28,30,32,34,36,38,40,42,44,46,48,51,53,55,58,60,62,65,67,70,72,75,77,80,82,85,87,90,92,95,97,100,102,105,107,110,112,115,117,120,122,125,127,130,132,134,137,139,141,144,146,148,150,152,154,157,159,161,163,165,167,169,171,172,174,176,178,180,181,183,185,186,188,190,191,193,194,196,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,1,2,2,3,4,4,5,6,7,7,8,9,10,12,13,14,15,17,18,19,21,23,24,26,28,29,31,33,35,37,39,41,43,45,47,49,52,54,56,58,61,63,65,68,70,73,75,78,80,83,85,88,90,93,95,98,100,103,105,108,110,113,115,118,120,123,125,127,130,132,135,137,139,141,144,146,148,150,152,155,157,159,161,163,165,167,169,170,172,174,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,5,6,6,7,8,9,10,11,12,14,15,16,17,19,20,22,23,25,27,28,30,32,34,36,38,40,42,44,46,48,50,52,55,57,59,61,64,66,69,71,73,76,78,81,83,86,88,91,93,96,98,101,103,106,108,111,113,116,118,120,123,125,128,130,132,135,137,139,142,144,146,148,150,152,155,157,159,161,163,165,167,169,170,172,174,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,13,14,16,17,18,20,21,23,24,26,28,29,31,33,35,37,39,41,43,45,47,49,51,53,55,58,60,62,65,67,69,72,74,77,79,81,84,86,89,91,94,96,99,101,104,106,109,111,114,116,118,121,123,126,128,130,133,135,137,139,142,144,146,148,150,153,155,157,159,161,163,165,167,169,170,172,174,176,178,179,181,183,185,186,188,189,191,192,194,195,197,198,200,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,6,7,8,9,9,10,12,13,14,15,16,18,19,21,22,24,25,27,28,30,32,34,36,37,39,41,43,45,48,50,52,54,56,58,61,63,65,68,70,72,75,77,80,82,84,87,89,92,94,97,99,102,104,107,109,111,114,116,119,121,123,126,128,131,133,135,137,140,142,144,146,148,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,179,181,183,184,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,2,2,3,3,4,4,5,6,7,7,8,9,10,11,12,13,15,16,17,19,20,21,23,24,26,28,29,31,33,35,36,38,40,42,44,46,48,50,53,55,57,59,61,64,66,68,71,73,75,78,80,83,85,88,90,92,95,97,100,102,105,107,109,112,114,117,119,121,124,126,128,131,133,135,138,140,142,144,146,149,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,179,181,183,184,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,3,4,4,5,6,6,7,8,9,10,11,12,13,14,15,17,18,19,21,22,24,25,27,28,30,32,34,35,37,39,41,43,45,47,49,51,53,56,58,60,62,65,67,69,71,74,76,78,81,83,86,88,90,93,95,98,100,103,105,107,110,112,115,117,119,122,124,126,129,131,133,136,138,140,142,144,147,149,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,179,181,183,184,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,5,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,22,23,25,26,28,29,31,33,34,36,38,40,42,44,46,48,50,52,54,56,59,61,63,65,68,70,72,74,77,79,82,84,86,89,91,93,96,98,101,103,105,108,110,113,115,117,120,122,124,127,129,131,134,136,138,140,142,145,147,149,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,6,7,7,8,9,10,11,12,13,14,16,17,18,20,21,22,24,25,27,28,30,32,34,35,37,39,41,43,45,47,49,51,53,55,57,59,62,64,66,68,71,73,75,77,80,82,84,87,89,92,94,96,99,101,104,106,108,111,113,115,118,120,122,125,127,129,132,134,136,138,140,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,174,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,237,238,239,239,240,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,6,6,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,29,31,33,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,67,69,71,73,76,78,80,83,85,87,90,92,95,97,99,102,104,106,109,111,113,116,118,120,123,125,127,130,132,134,136,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,174,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,249,249,249,249,249,250,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,6,6,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,24,25,27,29,30,32,33,35,37,39,41,42,44,46,48,50,52,54,57,59,61,63,65,67,70,72,74,76,79,81,83,86,88,90,93,95,97,100,102,104,107,109,112,114,116,118,121,123,125,128,130,132,134,137,139,141,143,145,147,149,152,154,156,158,160,162,163,165,167,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,5,5,6,7,8,8,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,28,29,31,33,34,36,38,40,41,43,45,47,49,51,53,55,57,59,62,64,66,68,70,73,75,77,79,82,84,86,89,91,93,96,98,100,103,105,107,110,112,114,117,119,121,123,126,128,130,132,135,137,139,141,143,145,148,150,152,154,156,158,160,162,164,165,167,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,200,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,5,5,6,7,7,8,9,10,11,12,13,14,15,16,17,19,20,21,23,24,26,27,29,30,32,33,35,37,39,40,42,44,46,48,50,52,54,56,58,60,62,64,67,69,71,73,75,78,80,82,85,87,89,91,94,96,98,101,103,105,108,110,112,115,117,119,122,124,126,128,131,133,135,137,139,141,144,146,148,150,152,154,156,158,160,162,164,166,168,169,171,173,175,176,178,180,182,183,185,186,188,190,191,193,194,195,197,198,200,201,202,204,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,232,232,233,234,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,247,247,248,248,248,249,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,4,4,5,6,6,7,8,9,10,11,11,12,14,15,16,17,18,19,21,22,23,25,26,28,29,31,33,34,36,38,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,72,74,76,78,81,83,85,87,90,92,94,97,99,101,104,106,108,111,113,115,117,120,122,124,126,129,131,133,135,137,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,169,171,173,175,177,178,180,182,183,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,5,6,7,8,8,9,10,11,12,13,14,15,16,18,19,20,21,23,24,26,27,29,30,32,33,35,37,38,40,42,44,46,48,49,51,53,55,57,60,62,64,66,68,70,72,75,77,79,81,84,86,88,90,93,95,97,99,102,104,106,109,111,113,116,118,120,122,125,127,129,131,133,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,178,180,182,183,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,2,2,3,3,4,4,5,5,6,7,7,8,9,10,11,12,13,14,15,16,17,18,20,21,22,24,25,26,28,29,31,32,34,36,37,39,41,43,45,46,48,50,52,54,56,58,60,62,64,67,69,71,73,75,77,80,82,84,86,89,91,93,95,98,100,102,105,107,109,111,114,116,118,120,123,125,127,129,132,134,136,138,140,142,144,146,149,151,153,155,157,159,160,162,164,166,168,170,172,173,175,177,179,180,182,184,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,232,233,234,234,235,236,236,237,237,238,239,239,240,240,241,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,5,5,6,7,7,8,9,10,11,11,12,13,14,16,17,18,19,20,22,23,24,26,27,29,30,32,33,35,37,38,40,42,44,45,47,49,51,53,55,57,59,61,63,65,67,69,72,74,76,78,80,82,85,87,89,91,94,96,98,101,103,105,107,110,112,114,116,119,121,123,125,127,130,132,134,136,138,140,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,174,175,177,179,180,182,184,185,187,188,190,191,193,194,196,197,199,200,201,203,204,205,206,208,209,210,211,212,213,214,215,217,218,219,220,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,233,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,242,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,6,6,7,8,9,9,10,11,12,13,14,15,16,17,19,20,21,22,24,25,26,28,29,31,32,34,36,37,39,41,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,77,79,81,83,85,88,90,92,94,97,99,101,103,106,108,110,112,115,117,119,121,123,126,128,130,132,134,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,168,170,172,174,175,177,179,181,182,184,185,187,189,190,192,193,195,196,197,199,200,201,203,204,205,206,208,209,210,211,212,213,215,216,217,218,219,220,221,222,222,223,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,5,6,7,8,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,26,27,29,30,32,33,35,36,38,40,41,43,45,47,49,51,52,54,56,58,60,62,64,67,69,71,73,75,77,79,82,84,86,88,90,93,95,97,99,102,104,106,108,111,113,115,117,119,122,124,126,128,130,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,170,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,197,199,200,202,203,204,205,207,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,223,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,4,4,5,5,6,7,7,8,9,10,11,11,12,13,14,15,16,18,19,20,21,22,24,25,26,28,29,31,32,34,36,37,39,40,42,44,46,48,49,51,53,55,57,59,61,63,65,67,69,71,74,76,78,80,82,84,87,89,91,93,95,98,100,102,104,107,109,111,113,115,118,120,122,124,126,129,131,133,135,137,139,141,143,146,148,150,152,154,156,158,159,161,163,165,167,169,171,172,174,176,178,179,181,183,184,186,187,189,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,4,4,5,5,6,6,7,8,9,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,26,27,29,30,32,33,35,36,38,40,41,43,45,47,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,81,83,85,87,89,92,94,96,98,100,103,105,107,109,111,114,116,118,120,122,125,127,129,131,133,135,138,140,142,144,146,148,150,152,154,156,158,160,162,163,165,167,169,171,173,174,176,178,179,181,183,184,186,187,189,191,192,194,195,196,198,199,200,202,203,204,206,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,237,238,239,239,240,240,241,241,242,242,242,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,250,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,6,6,7,8,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,28,29,31,32,34,35,37,39,40,42,44,45,47,49,51,53,55,57,59,60,62,64,67,69,71,73,75,77,79,81,83,86,88,90,92,94,96,99,101,103,105,108,110,112,114,116,119,121,123,125,127,129,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,167,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,233,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,5,6,7,7,8,9,10,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,29,30,32,33,35,36,38,39,41,43,44,46,48,50,52,53,55,57,59,61,63,65,67,69,71,73,75,78,80,82,84,86,88,90,93,95,97,99,101,104,106,108,110,112,115,117,119,121,123,125,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,230,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,5,6,7,7,8,9,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,27,28,29,31,32,34,35,37,38,40,42,43,45,47,49,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,85,87,89,91,93,95,98,100,102,104,106,109,111,113,115,117,119,122,124,126,128,130,132,134,137,139,141,143,145,147,149,151,153,155,157,159,161,162,164,166,168,170,172,173,175,177,178,180,182,183,185,187,188,190,191,193,194,195,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,241,241,242,242,242,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,11,12,13,13,14,15,16,17,19,20,21,22,23,25,26,27,29,30,31,33,34,36,38,39,41,42,44,46,48,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,92,94,96,98,100,102,105,107,109,111,113,116,118,120,122,124,126,128,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,166,168,170,172,174,175,177,179,180,182,184,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,208,209,210,211,212,213,214,216,217,218,219,220,221,222,222,223,224,225,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,237,238,239,239,240,240,241,241,242,242,243,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,4,4,5,6,6,7,7,8,9,10,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,31,32,34,35,37,38,40,41,43,45,47,48,50,52,54,56,57,59,61,63,65,67,69,71,73,75,77,79,82,84,86,88,90,92,94,96,99,101,103,105,107,109,112,114,116,118,120,122,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,168,170,172,174,175,177,179,181,182,184,185,187,188,190,192,193,194,196,197,199,200,201,203,204,205,207,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,224,225,226,227,228,229,229,230,231,232,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,4,4,5,5,6,7,7,8,9,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,29,30,31,33,34,36,37,39,41,42,44,46,47,49,51,53,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,91,93,95,97,99,101,103,106,108,110,112,114,116,119,121,123,125,127,129,131,133,136,138,140,142,144,146,148,150,152,154,156,158,159,161,163,165,167,169,171,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,198,199,200,202,203,204,205,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,230,230,231,232,233,233,234,235,235,236,237,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,11,12,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,31,32,34,35,37,38,40,41,43,45,46,48,50,51,53,55,57,59,61,63,65,67,68,70,72,75,77,79,81,83,85,87,89,91,93,95,98,100,102,104,106,108,110,113,115,117,119,121,123,125,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,179,181,183,184,186,187,189,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,231,231,232,233,233,234,235,235,236,237,237,238,238,239,240,240,241,241,242,242,243,243,243,244,244,245,245,246,246,246,247,247,247,248,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,20,21,22,23,25,26,27,29,30,31,33,34,36,37,39,40,42,44,45,47,49,50,52,54,56,58,59,61,63,65,67,69,71,73,75,77,79,81,83,85,88,90,92,94,96,98,100,102,105,107,109,111,113,115,117,120,122,124,126,128,130,132,134,136,138,140,142,145,147,149,150,152,154,156,158,160,162,164,166,168,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,232,232,233,234,234,235,236,236,237,237,238,239,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,6,6,7,7,8,9,9,10,11,12,13,14,14,15,16,17,18,19,21,22,23,24,25,27,28,29,31,32,33,35,36,38,39,41,43,44,46,48,49,51,53,55,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,97,99,101,103,105,107,109,111,114,116,118,120,122,124,126,128,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,160,162,164,166,168,170,171,173,175,177,178,180,182,183,185,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,207,209,210,211,212,213,214,215,217,218,219,220,221,222,223,223,224,225,226,227,228,229,229,230,231,232,232,233,234,235,235,236,236,237,238,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,7,7,8,8,9,10,11,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,29,30,31,33,34,36,37,39,40,42,43,45,47,48,50,52,54,55,57,59,61,63,65,67,68,70,72,74,76,78,80,82,85,87,89,91,93,95,97,99,101,103,106,108,110,112,114,116,118,120,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,179,180,182,183,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,208,209,210,211,212,213,215,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,230,230,231,232,233,233,234,235,235,236,237,237,238,238,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,31,32,33,35,36,38,39,41,42,44,46,47,49,51,52,54,56,58,60,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,96,98,100,102,104,106,108,110,112,115,117,119,121,123,125,127,129,131,133,136,138,140,142,144,146,148,150,152,154,155,157,159,161,163,165,167,168,170,172,174,175,177,179,180,182,184,185,187,188,190,191,193,194,196,197,199,200,201,203,204,205,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,231,231,232,233,234,234,235,236,236,237,237,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,246,247,247,248,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,5,6,6,7,7,8,9,9,10,11,12,13,13,14,15,16,17,18,19,20,21,22,24,25,26,27,29,30,31,33,34,35,37,38,40,41,43,45,46,48,50,51,53,55,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,105,107,109,111,113,115,117,119,121,123,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,161,163,165,167,169,171,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,232,232,233,234,234,235,236,236,237,238,238,239,239,240,240,241,242,242,243,243,243,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,4,5,5,6,7,7,8,8,9,10,11,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,31,32,33,35,36,38,39,41,42,44,45,47,49,50,52,54,56,57,59,61,63,65,67,68,70,72,74,76,78,80,82,84,86,88,90,92,95,97,99,101,103,105,107,109,111,113,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,179,181,183,184,186,187,189,191,192,194,195,196,198,199,201,202,203,205,206,207,208,210,211,212,213,214,215,216,217,218,220,221,221,222,223,224,225,226,227,228,229,229,230,231,232,233,233,234,235,235,236,237,237,238,238,239,240,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,248,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,14,15,16,17,18,19,20,21,23,24,25,26,27,29,30,31,33,34,35,37,38,40,41,43,44,46,48,49,51,53,54,56,58,60,62,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,106,108,110,112,114,116,118,120,122,124,126,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,158,160,162,164,166,168,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,199,201,202,204,205,206,207,209,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,225,226,227,228,229,230,230,231,232,233,233,234,235,236,236,237,237,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,9,9,10,11,12,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,32,33,35,36,37,39,40,42,43,45,47,48,50,52,53,55,57,59,60,62,64,66,68,70,72,74,75,77,79,81,83,85,87,90,92,94,96,98,100,102,104,106,108,110,112,114,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,178,180,182,183,185,187,188,190,191,193,194,196,197,198,200,201,202,204,205,206,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,227,227,228,229,230,231,231,232,233,234,234,235,236,236,237,238,238,239,239,240,241,241,242,242,243,243,244,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,10,11,11,12,13,14,15,16,16,17,18,19,20,21,23,24,25,26,27,29,30,31,32,34,35,37,38,40,41,43,44,46,47,49,51,52,54,56,57,59,61,63,65,67,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,105,107,109,111,113,115,117,119,121,123,125,127,129,132,134,136,138,140,142,144,146,148,150,152,153,155,157,159,161,163,165,167,168,170,172,174,175,177,179,180,182,184,185,187,188,190,191,193,194,196,197,199,200,201,203,204,205,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,229,230,231,232,232,233,234,235,235,236,237,237,238,238,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,249,249,249,249,250,250,250,251,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,4,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,13,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,32,33,34,36,37,39,40,42,43,45,46,48,50,51,53,55,56,58,60,62,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,161,163,165,167,169,170,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,198,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,218,220,221,222,222,223,224,225,226,227,228,229,230,230,231,232,233,233,234,235,236,236,237,237,238,239,239,240,240,241,241,242,243,243,243,244,244,245,245,246,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,9,9,10,11,12,12,13,14,15,16,17,18,18,19,20,22,23,24,25,26,27,28,30,31,32,34,35,36,38,39,41,42,44,45,47,49,50,52,54,55,57,59,60,62,64,66,68,70,72,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,139,141,143,145,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,179,181,183,184,186,187,189,191,192,194,195,196,198,199,201,202,203,205,206,207,208,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,226,227,228,229,230,231,231,232,233,234,234,235,236,236,237,238,238,239,240,240,241,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,8,9,10,11,11,12,13,14,14,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,32,33,34,36,37,38,40,41,43,44,46,48,49,51,52,54,56,58,59,61,63,65,67,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,158,160,162,164,166,168,169,171,173,175,176,178,180,181,183,185,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,232,232,233,234,235,235,236,237,237,238,239,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,5,6,7,7,8,8,9,10,10,11,12,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30,31,32,34,35,36,38,39,41,42,44,45,47,48,50,51,53,55,56,58,60,62,64,65,67,69,71,73,75,77,78,80,82,84,86,88,90,92,94,96,98,100,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,178,180,182,183,185,187,188,190,191,193,194,196,197,199,200,201,203,204,205,207,208,209,210,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,230,231,232,233,233,234,235,236,236,237,238,238,239,239,240,241,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,4,4,4,5,5,6,6,7,7,8,9,9,10,11,11,12,13,14,15,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,32,33,34,35,37,38,40,41,43,44,46,47,49,50,52,54,55,57,59,61,62,64,66,68,70,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,155,157,159,161,163,165,167,168,170,172,174,175,177,179,180,182,184,185,187,189,190,192,193,195,196,197,199,200,202,203,204,206,207,208,209,211,212,213,214,215,216,217,219,220,221,222,223,224,225,225,226,227,228,229,230,231,231,232,233,234,234,235,236,237,237,238,238,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,249,250,250,250,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,8,9,10,10,11,12,13,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30,31,32,33,35,36,37,39,40,42,43,45,46,48,49,51,53,54,56,58,59,61,63,65,67,68,70,72,74,76,78,80,82,84,85,87,89,91,93,95,97,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,163,165,167,169,171,172,174,176,178,179,181,182,184,186,187,189,190,192,193,195,196,198,199,201,202,203,205,206,207,208,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,232,232,233,234,235,235,236,237,237,238,239,239,240,240,241,242,242,243,243,244,244,245,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,8,9,10,10,11,12,12,13,14,15,16,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,33,34,35,37,38,39,41,42,44,45,47,48,50,52,53,55,57,58,60,62,64,65,67,69,71,73,75,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,167,169,171,173,174,176,178,180,181,183,184,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,208,209,210,211,212,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,230,231,232,233,234,234,235,236,236,237,238,238,239,240,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,249,250,250,250,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,9,9,10,11,11,12,13,14,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30,31,32,33,35,36,37,39,40,42,43,44,46,48,49,51,52,54,56,57,59,61,62,64,66,68,70,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,160,162,164,166,168,170,171,173,175,177,178,180,182,183,185,186,188,190,191,193,194,196,197,198,200,201,203,204,205,207,208,209,210,212,213,214,215,216,217,218,219,221,222,223,224,225,225,226,227,228,229,230,231,231,232,233,234,235,235,236,237,237,238,239,239,240,240,241,241,242,243,243,244,244,244,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,10,10,11,12,12,13,14,15,16,17,17,18,19,20,21,22,23,24,25,27,28,29,30,31,33,34,35,37,38,39,41,42,44,45,47,48,50,51,53,54,56,58,60,61,63,65,67,68,70,72,74,76,78,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,124,126,128,130,132,134,136,138,140,142,144,146,148,149,151,153,155,157,159,161,163,165,166,168,170,172,174,175,177,179,180,182,184,185,187,188,190,192,193,195,196,197,199,200,202,203,204,206,207,208,209,211,212,213,214,215,217,218,219,220,221,222,223,224,225,226,227,228,228,229,230,231,232,233,233,234,235,236,236,237,238,238,239,239,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,14,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,36,37,38,40,41,43,44,46,47,49,50,52,53,55,57,58,60,62,64,65,67,69,71,73,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,159,161,163,165,167,169,170,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,198,199,201,202,203,205,206,207,209,210,211,212,213,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,230,231,232,233,234,234,235,236,237,237,238,238,239,240,240,241,241,242,243,243,244,244,244,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,5,6,6,7,7,8,9,9,10,11,11,12,13,13,14,15,16,17,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,34,35,36,38,39,40,42,43,45,46,48,49,51,52,54,56,57,59,61,62,64,66,68,69,71,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,127,129,131,133,135,137,139,141,143,145,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,179,181,183,184,186,188,189,191,192,194,195,197,198,200,201,202,204,205,206,208,209,210,211,213,214,215,216,217,218,219,220,222,223,224,225,225,226,227,228,229,230,231,232,232,233,234,235,235,236,237,237,238,239,239,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,10,10,11,12,12,13,14,15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,36,37,38,40,41,42,44,45,47,48,50,51,53,55,56,58,60,61,63,65,66,68,70,72,74,76,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,158,160,162,164,166,168,169,171,173,175,176,178,180,182,183,185,186,188,190,191,193,194,196,197,199,200,201,203,204,205,207,208,209,211,212,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,229,230,231,232,233,233,234,235,236,236,237,238,238,239,240,240,241,241,242,242,243,244,244,244,245,245,246,246,247,247,247,248,248,249,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,16,17,18,18,19,20,21,22,23,24,25,26,28,29,30,31,32,34,35,36,37,39,40,42,43,44,46,47,49,50,52,54,55,57,58,60,62,64,65,67,69,71,72,74,76,78,80,82,84,86,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,130,132,134,136,138,140,142,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,179,180,182,184,185,187,188,190,192,193,195,196,197,199,200,202,203,204,206,207,208,210,211,212,213,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,231,232,233,234,235,235,236,237,237,238,239,239,240,241,241,242,242,243,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,5,6,6,7,7,8,9,9,10,10,11,12,12,13,14,15,16,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,37,38,39,41,42,44,45,46,48,49,51,53,54,56,57,59,61,62,64,66,68,69,71,73,75,77,79,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,157,159,161,163,165,167,169,170,172,174,176,177,179,181,182,184,186,187,189,190,192,193,195,196,198,199,201,202,204,205,206,208,209,210,211,213,214,215,216,217,218,219,220,222,223,224,225,226,226,227,228,229,230,231,232,233,233,234,235,236,236,237,238,238,239,240,240,241,241,242,242,243,244,244,245,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,10,10,11,11,12,13,14,14,15,16,17,18,19,19,20,21,22,23,24,25,26,28,29,30,31,32,33,35,36,37,39,40,41,43,44,46,47,49,50,52,53,55,56,58,60,61,63,65,66,68,70,72,74,75,77,79,81,83,85,87,89,91,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,131,133,135,137,139,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,179,181,183,184,186,188,189,191,192,194,195,197,198,200,201,203,204,205,207,208,209,210,212,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,230,230,231,232,233,234,234,235,236,237,237,238,239,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,16,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,38,39,40,42,43,45,46,48,49,51,52,54,55,57,59,60,62,64,65,67,69,71,72,74,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,156,158,160,162,164,166,168,169,171,173,175,176,178,180,182,183,185,186,188,190,191,193,194,196,197,199,200,202,203,204,206,207,208,210,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,232,233,234,235,235,236,237,238,238,239,240,240,241,241,242,242,243,244,244,245,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,8,9,9,10,10,11,12,12,13,14,14,15,16,17,18,19,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,36,37,38,40,41,42,44,45,47,48,50,51,53,54,56,57,59,61,62,64,66,68,69,71,73,75,77,78,80,82,84,86,88,90,92,94,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,179,180,182,184,185,187,188,190,192,193,195,196,198,199,201,202,203,205,206,207,209,210,211,212,214,215,216,217,218,219,220,222,223,224,225,226,227,227,228,229,230,231,232,233,233,234,235,236,236,237,238,239,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,5,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,16,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,38,39,40,42,43,44,46,47,49,50,52,53,55,56,58,60,61,63,65,66,68,70,72,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,157,159,161,163,165,167,169,170,172,174,176,177,179,181,182,184,186,187,189,190,192,194,195,197,198,200,201,202,204,205,206,208,209,210,212,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,230,231,231,232,233,234,235,235,236,237,238,238,239,240,240,241,241,242,242,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12,12,13,14,15,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28,30,31,32,33,34,36,37,38,39,41,42,43,45,46,48,49,51,52,54,55,57,59,60,62,64,65,67,69,70,72,74,76,78,79,81,83,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,163,165,167,169,171,173,174,176,178,179,181,183,185,186,188,189,191,192,194,196,197,198,200,201,203,204,206,207,208,209,211,212,213,214,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,233,234,235,236,236,237,238,239,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,8,8,9,10,10,11,11,12,13,13,14,15,16,17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,43,44,45,47,48,50,51,53,54,56,58,59,61,62,64,66,67,69,71,73,75,76,78,80,82,84,86,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,156,158,160,162,164,166,168,169,171,173,175,177,178,180,182,183,185,187,188,190,191,193,194,196,197,199,200,202,203,205,206,207,209,210,211,212,214,215,216,217,218,219,221,222,223,224,225,226,227,228,229,229,230,231,232,233,234,234,235,236,237,237,238,239,239,240,241,241,242,242,243,244,244,245,245,246,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,37,38,39,40,42,43,45,46,47,49,50,52,53,55,56,58,60,61,63,65,66,68,70,72,73,75,77,79,81,82,84,86,88,90,92,94,96,98,100,102,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,173,175,177,179,180,182,184,185,187,189,190,192,193,195,196,198,199,201,202,204,205,206,208,209,210,212,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,232,233,234,235,236,236,237,238,238,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12,12,13,14,14,15,16,17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,41,42,44,45,46,48,49,51,52,54,55,57,59,60,62,63,65,67,69,70,72,74,76,77,79,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,157,159,161,163,165,167,169,170,172,174,176,177,179,181,183,184,186,187,189,191,192,194,195,197,198,200,201,203,204,205,207,208,209,211,212,213,214,216,217,218,219,220,221,222,223,224,226,226,227,228,229,230,231,232,233,234,234,235,236,237,237,238,239,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,38,39,40,41,43,44,46,47,48,50,51,53,54,56,58,59,61,62,64,66,67,69,71,73,74,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,105,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,174,176,178,180,181,183,185,186,188,190,191,193,194,196,197,199,200,202,203,204,206,207,209,210,211,212,214,215,216,217,218,220,221,222,223,224,225,226,227,228,229,230,231,231,232,233,234,235,236,236,237,238,238,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,7,7,8,8,9,9,10,10,11,12,12,13,14,14,15,16,17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,41,42,43,45,46,48,49,50,52,53,55,56,58,60,61,63,65,66,68,70,71,73,75,77,78,80,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,156,158,160,162,164,166,168,170,171,173,175,177,178,180,182,183,185,187,188,190,192,193,195,196,198,199,201,202,204,205,206,208,209,210,212,213,214,215,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,234,235,236,237,237,238,239,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,39,40,41,42,44,45,47,48,49,51,52,54,55,57,59,60,62,63,65,67,68,70,72,74,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,174,175,177,179,181,182,184,186,187,189,190,192,194,195,197,198,200,201,203,204,205,207,208,209,211,212,213,215,216,217,218,219,220,221,223,224,225,226,227,228,229,230,230,231,232,233,234,235,235,236,237,238,238,239,240,240,241,242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,4,4,4,5,5,6,6,6,7,7,8,8,9,9,10,11,11,12,12,13,14,14,15,16,17,17,18,19,20,21,22,23,24,24,25,26,27,29,30,31,32,33,34,35,37,38,39,40,42,43,44,46,47,49,50,51,53,54,56,58,59,61,62,64,66,67,69,71,72,74,76,78,80,81,83,85,87,89,91,93,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,157,159,161,163,165,167,169,170,172,174,176,178,179,181,183,184,186,188,189,191,193,194,196,197,199,200,202,203,204,206,207,209,210,211,212,214,215,216,217,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,233,234,235,236,237,237,238,239,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,16,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,40,41,42,43,45,46,48,49,50,52,53,55,56,58,60,61,63,64,66,68,69,71,73,75,76,78,80,82,84,86,87,89,91,93,95,97,99,101,103,105,107,109,111,113,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,175,176,178,180,182,183,185,187,188,190,191,193,195,196,198,199,201,202,204,205,206,208,209,210,212,213,214,215,217,218,219,220,221,222,223,224,226,227,228,228,229,230,231,232,233,234,235,235,236,237,238,238,239,240,240,241,242,242,243,243,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,11,11,12,12,13,14,14,15,16,17,17,18,19,20,21,22,23,23,24,25,26,27,28,29,31,32,33,34,35,36,38,39,40,41,43,44,45,47,48,50,51,52,54,55,57,59,60,62,63,65,67,68,70,72,73,75,77,79,81,82,84,86,88,90,92,94,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,158,160,162,164,166,168,170,171,173,175,177,179,180,182,184,185,187,189,190,192,193,195,197,198,200,201,203,204,205,207,208,209,211,212,213,215,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,233,234,235,236,237,237,238,239,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,248,248,248,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,6,7,7,8,8,9,9,10,10,11,12,12,13,13,14,15,16,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,42,43,44,46,47,49,50,51,53,54,56,57,59,61,62,64,65,67,69,70,72,74,76,77,79,81,83,85,87,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,166,168,170,172,174,176,177,179,181,183,184,186,188,189,191,192,194,196,197,199,200,202,203,204,206,207,209,210,211,213,214,215,216,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,238,239,240,240,241,242,242,243,244,244,245,245,246,246,247,247,248,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20,21,22,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,40,41,42,44,45,46,48,49,51,52,53,55,56,58,60,61,63,64,66,68,69,71,73,74,76,78,80,82,83,85,87,89,91,93,95,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,159,161,163,165,167,169,171,172,174,176,178,180,181,183,185,186,188,190,191,193,194,196,198,199,201,202,204,205,206,208,209,210,212,213,214,216,217,218,219,220,221,223,224,225,226,227,228,229,230,231,232,232,233,234,235,236,237,237,238,239,240,240,241,241,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,10,10,11,12,12,13,14,14,15,16,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,43,44,45,47,48,50,51,52,54,55,57,58,60,62,63,65,66,68,70,71,73,75,77,78,80,82,84,86,88,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,167,169,171,173,175,177,178,180,182,184,185,187,189,190,192,193,195,197,198,200,201,203,204,205,207,208,210,211,212,214,215,216,217,218,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,238,239,240,241,241,242,242,243,244,244,245,245,246,246,247,247,248,248,248,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,6,6,6,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,41,42,43,45,46,47,49,50,51,53,54,56,57,59,61,62,64,65,67,69,70,72,74,75,77,79,81,83,84,86,88,90,92,94,96,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,160,162,164,166,168,170,172,173,175,177,179,181,182,184,186,187,189,191,192,194,195,197,199,200,202,203,204,206,207,209,210,211,213,214,215,216,218,219,220,221,222,223,225,226,227,228,229,230,231,231,232,233,234,235,236,237,237,238,239,240,240,241,242,242,243,243,244,245,245,246,246,247,247,247,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,11,11,12,12,13,14,14,15,16,16,17,18,19,19,20,21,22,23,24,25,26,26,27,28,30,31,32,33,34,35,36,37,39,40,41,42,44,45,46,48,49,50,52,53,55,56,58,59,61,63,64,66,67,69,71,72,74,76,78,79,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,141,143,145,147,149,151,153,155,157,159,161,163,165,167,168,170,172,174,176,178,179,181,183,185,186,188,190,191,193,194,196,198,199,201,202,204,205,206,208,209,211,212,213,214,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,238,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,42,43,44,45,47,48,50,51,52,54,55,57,58,60,61,63,65,66,68,70,71,73,75,76,78,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,161,163,165,167,169,171,173,174,176,178,180,182,183,185,187,188,190,192,193,195,196,198,200,201,203,204,205,207,208,210,211,212,214,215,216,217,219,220,221,222,223,224,225,227,228,229,230,230,231,232,233,234,235,236,237,237,238,239,240,240,241,242,242,243,243,244,245,245,246,246,247,247,248,248,248,249,249,250,250,250,251,251,251,252,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,16,16,17,18,19,19,20,21,22,23,24,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,41,42,43,45,46,47,49,50,51,53,54,56,57,59,60,62,64,65,67,68,70,72,73,75,77,79,80,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,180,182,184,186,187,189,191,192,194,195,197,199,200,202,203,205,206,207,209,210,212,213,214,215,217,218,219,220,221,223,224,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,239,239,240,241,241,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,44,45,46,48,49,50,52,53,55,56,58,59,61,62,64,66,67,69,71,72,74,76,77,79,81,83,84,86,88,90,92,94,96,98,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,164,166,168,170,172,174,176,177,179,181,183,184,186,188,189,191,193,194,196,198,199,201,202,204,205,206,208,209,211,212,213,215,216,217,218,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,237,238,239,240,240,241,242,242,243,244,244,245,245,246,246,247,247,248,248,249,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,16,16,17,18,18,19,20,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,36,37,38,39,40,42,43,44,45,47,48,50,51,52,54,55,57,58,60,61,63,64,66,68,69,71,73,74,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,149,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,180,181,183,185,187,188,190,192,193,195,196,198,200,201,203,204,206,207,208,210,211,213,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,239,239,240,241,241,242,243,243,244,245,245,246,246,247,247,248,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,10,11,11,12,13,13,14,15,15,16,17,17,18,19,20,20,21,22,23,24,25,26,27,28,28,30,31,32,33,34,35,36,37,38,40,41,42,43,45,46,47,49,50,51,53,54,56,57,59,60,62,63,65,67,68,70,71,73,75,77,78,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,165,167,169,171,173,175,177,178,180,182,184,185,187,189,191,192,194,195,197,199,200,202,203,205,206,208,209,210,212,213,214,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,237,238,239,240,240,241,242,242,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,16,16,17,18,18,19,20,21,22,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,46,48,49,50,52,53,55,56,58,59,61,62,64,65,67,69,70,72,74,75,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,168,170,172,173,175,177,179,181,182,184,186,188,189,191,193,194,196,198,199,201,202,204,205,207,208,209,211,212,214,215,216,217,219,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,235,236,237,238,239,239,240,241,241,242,243,243,244,245,245,246,246,247,247,248,248,249,249,249,250,250,251,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,12,12,13,13,14,15,15,16,17,17,18,19,20,20,21,22,23,24,25,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,42,43,44,45,47,48,49,51,52,54,55,57,58,60,61,63,64,66,67,69,71,72,74,76,77,79,81,83,85,86,88,90,92,94,96,98,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,168,170,172,174,176,178,179,181,183,185,187,188,190,192,193,195,196,198,200,201,203,204,206,207,209,210,211,213,214,215,217,218,219,220,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,237,238,239,240,241,241,242,243,243,244,244,245,246,246,247,247,248,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,15,16,17,18,18,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,45,46,47,48,50,51,53,54,56,57,58,60,62,63,65,66,68,69,71,73,75,76,78,80,81,83,85,87,89,91,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,157,159,161,163,165,167,169,171,173,175,176,178,180,182,184,185,187,189,190,192,194,195,197,199,200,202,203,205,206,208,209,211,212,213,215,216,217,218,220,221,222,223,224,226,227,228,229,230,231,232,233,234,235,235,236,237,238,239,239,240,241,242,242,243,244,244,245,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,12,12,13,13,14,14,15,16,16,17,18,19,19,20,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,46,48,49,50,52,53,54,56,57,59,60,62,64,65,67,68,70,72,73,75,77,78,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,182,184,186,188,189,191,193,194,196,198,199,201,202,204,205,207,208,210,211,212,214,215,216,218,219,220,221,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,238,239,240,241,241,242,243,243,244,245,245,246,246,247,247,248,248,249,249,249,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,7,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,15,16,17,18,18,19,20,21,21,22,23,24,25,26,27,27,28,29,30,31,32,34,35,36,37,38,39,40,42,43,44,45,47,48,49,51,52,53,55,56,58,59,61,62,64,66,67,69,70,72,74,75,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,160,162,164,166,168,170,172,174,176,177,179,181,183,185,186,188,190,192,193,195,197,198,200,201,203,204,206,207,209,210,212,213,214,216,217,218,220,221,222,223,224,225,227,228,229,230,231,232,233,234,235,235,236,237,238,239,240,240,241,242,242,243,244,244,245,245,246,247,247,248,248,248,249,249,250,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,9,10,10,11,12,12,13,13,14,14,15,16,16,17,18,19,19,20,21,22,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,46,47,48,50,51,52,54,55,57,58,60,61,63,64,66,68,69,71,72,74,76,78,79,81,83,85,86,88,90,92,94,96,98,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,172,174,176,178,180,182,183,185,187,189,190,192,194,195,197,199,200,202,203,205,206,208,209,211,212,214,215,216,218,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,238,239,240,241,241,242,243,243,244,245,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,10,10,11,11,12,12,13,14,14,15,15,16,17,17,18,19,20,20,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,46,47,49,50,51,53,54,56,57,59,60,62,63,65,66,68,70,71,73,75,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,115,117,119,121,123,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,163,165,167,169,171,173,175,177,179,180,182,184,186,188,189,191,193,194,196,198,199,201,202,204,205,207,208,210,211,213,214,215,217,218,219,221,222,223,224,225,226,228,229,230,231,232,233,234,235,235,236,237,238,239,240,240,241,242,243,243,244,244,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,9,10,10,11,12,12,13,13,14,14,15,16,16,17,18,18,19,20,21,21,22,23,24,25,26,27,28,28,29,30,31,32,34,35,36,37,38,39,40,41,43,44,45,46,48,49,50,52,53,55,56,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,175,177,179,181,183,185,186,188,190,192,193,195,197,198,200,201,203,205,206,208,209,210,212,213,215,216,217,219,220,221,222,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,238,239,240,241,242,242,243,244,244,245,245,246,247,247,248,248,249,249,249,250,250,251,251,251,252,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,15,15,16,17,17,18,19,19,20,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,46,47,48,50,51,52,54,55,57,58,59,61,62,64,66,67,69,70,72,74,75,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,112,114,116,118,120,122,124,126,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,168,170,172,174,176,178,180,182,183,185,187,189,190,192,194,196,197,199,200,202,204,205,207,208,210,211,212,214,215,217,218,219,220,222,223,224,225,226,228,229,230,231,232,233,234,235,236,236,237,238,239,240,241,241,242,243,243,244,245,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,7,7,7,8,8,9,9,10,10,10,11,12,12,13,13,14,14,15,16,16,17,18,18,19,20,21,21,22,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,43,45,46,47,49,50,51,53,54,55,57,58,60,61,63,64,66,68,69,71,72,74,76,78,79,81,83,85,86,88,90,92,94,96,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,178,180,182,184,186,188,189,191,193,194,196,198,199,201,203,204,206,207,209,210,212,213,214,216,217,218,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,239,240,241,242,242,243,244,244,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,15,15,16,17,17,18,19,19,20,21,22,22,23,24,25,26,27,28,29,29,30,31,32,34,35,36,37,38,39,40,41,43,44,45,46,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,70,71,73,75,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,109,111,113,115,117,119,121,123,125,127,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,185,186,188,190,192,193,195,197,198,200,202,203,205,206,208,209,211,212,214,215,216,218,219,220,222,223,224,225,226,227,229,230,231,232,233,234,235,236,237,237,238,239,240,241,241,242,243,243,244,245,245,246,247,247,248,248,249,249,249,250,250,251,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,10,10,10,11,11,12,13,13,14,14,15,16,16,17,17,18,19,20,20,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,47,48,49,51,52,53,55,56,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,84,85,87,89,91,93,95,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,181,183,185,187,189,190,192,194,196,197,199,201,202,204,205,207,208,210,211,213,214,216,217,218,220,221,222,223,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,240,241,242,243,243,244,245,245,246,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,15,15,16,16,17,18,18,19,20,21,21,22,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,45,46,47,48,50,51,52,54,55,57,58,59,61,62,64,66,67,69,70,72,74,75,77,79,80,82,84,86,88,89,91,93,95,97,99,101,103,105,106,108,110,112,114,116,118,120,122,124,126,128,130,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,176,178,180,182,184,186,187,189,191,193,194,196,198,200,201,203,204,206,207,209,210,212,213,215,216,217,219,220,221,223,224,225,226,227,229,230,231,232,233,234,235,236,237,237,238,239,240,241,242,242,243,244,244,245,246,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,10,10,10,11,11,12,13,13,14,14,15,15,16,17,17,18,19,19,20,21,22,23,23,24,25,26,27,28,29,29,30,31,32,33,35,36,37,38,39,40,41,42,44,45,46,47,49,50,51,53,54,56,57,58,60,61,63,64,66,68,69,71,72,74,76,77,79,81,83,84,86,88,90,92,94,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,193,195,197,198,200,202,203,205,206,208,210,211,212,214,215,217,218,219,221,222,223,224,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,240,241,242,243,243,244,245,245,246,247,247,248,248,249,249,250,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,16,16,17,18,18,19,20,20,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,70,71,73,74,76,78,80,81,83,85,87,88,90,92,94,96,98,100,102,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,179,181,183,185,187,189,190,192,194,196,197,199,201,202,204,206,207,209,210,212,213,215,216,217,219,220,221,223,224,225,226,227,229,230,231,232,233,234,235,236,237,238,238,239,240,241,242,242,243,244,244,245,246,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,14,14,15,15,16,17,17,18,19,19,20,21,22,22,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,46,47,48,49,51,52,53,55,56,58,59,61,62,64,65,67,68,70,72,73,75,76,78,80,82,83,85,87,89,91,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,157,159,161,163,165,167,169,170,172,174,176,178,180,182,184,186,187,189,191,193,195,196,198,200,201,203,205,206,208,209,211,212,214,215,217,218,219,221,222,223,224,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,241,242,243,244,244,245,246,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,16,16,17,17,18,19,20,20,21,22,23,23,24,25,26,27,28,29,29,30,31,32,33,34,35,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,57,58,59,61,62,64,65,67,69,70,72,74,75,77,79,80,82,84,86,87,89,91,93,95,97,99,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,193,195,197,199,200,202,204,205,207,208,210,211,213,214,216,217,219,220,221,222,224,225,226,227,229,230,231,232,233,234,235,236,237,238,239,239,240,241,242,243,243,244,245,245,246,247,247,248,248,249,249,250,250,250,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14,15,15,16,16,17,18,18,19,20,21,21,22,23,24,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,49,50,51,53,54,55,57,58,60,61,63,64,66,67,69,71,72,74,76,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,154,156,158,160,162,164,166,168,170,172,174,176,177,179,181,183,185,187,189,190,192,194,196,198,199,201,203,204,206,207,209,210,212,213,215,216,218,219,220,222,223,224,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,242,243,244,244,245,246,246,247,247,248,249,249,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,8,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,19,19,20,21,22,22,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,86,88,90,92,94,96,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,187,189,191,193,195,196,198,200,202,203,205,206,208,210,211,213,214,216,217,218,220,221,222,224,225,226,227,229,230,231,232,233,234,235,236,237,238,239,240,240,241,242,243,243,244,245,246,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,16,16,17,18,18,19,20,20,21,22,23,23,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,46,47,48,49,51,52,53,55,56,58,59,60,62,63,65,67,68,70,71,73,75,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,109,111,113,115,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,182,184,186,188,190,192,194,195,197,199,200,202,204,205,207,209,210,212,213,215,216,218,219,220,222,223,224,226,227,228,229,230,231,232,234,235,236,236,237,238,239,240,241,242,242,243,244,245,245,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,11,11,11,12,13,13,14,14,15,15,16,17,17,18,18,19,20,21,21,22,23,24,24,25,26,27,28,29,30,31,32,32,33,34,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,84,85,87,89,91,93,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,192,194,196,198,199,201,203,204,206,208,209,211,212,214,215,217,218,220,221,222,224,225,226,227,229,230,231,232,233,234,235,236,237,238,239,240,241,241,242,243,244,244,245,246,246,247,248,248,249,249,250,250,250,251,251,252,252,252,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,16,16,17,17,18,19,19,20,21,22,22,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,49,50,51,53,54,55,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,86,87,89,91,93,95,97,99,101,102,104,106,108,110,112,114,116,118,120,122,125,127,129,131,133,135,137,139,141,143,145,147,149,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,187,189,191,193,195,197,198,200,202,203,205,207,208,210,211,213,214,216,217,219,220,222,223,224,225,227,228,229,230,231,233,234,235,236,237,238,238,239,240,241,242,243,243,244,245,246,246,247,247,248,248,249,249,250,250,251,251,252,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,15,15,16,16,17,18,18,19,20,20,21,22,23,23,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,71,72,74,76,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,140,142,144,146,148,150,152,154,156,158,160,162,164,167,169,171,173,175,177,179,180,182,184,186,188,190,192,194,195,197,199,201,202,204,206,207,209,211,212,214,215,217,218,219,221,222,224,225,226,227,229,230,231,232,233,234,235,236,237,238,239,240,241,242,242,243,244,245,245,246,247,247,248,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,20,21,21,22,23,24,24,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,40,41,42,43,44,45,47,48,49,50,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,86,88,90,92,94,96,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,130,132,134,136,138,140,142,144,146,148,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,192,194,196,198,200,201,203,205,206,208,210,211,213,214,216,217,219,220,221,223,224,225,227,228,229,230,231,233,234,235,236,237,238,239,240,240,241,242,243,244,244,245,246,246,247,248,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,16,16,17,17,18,19,19,20,21,21,22,23,24,25,25,26,27,28,29,30,31,32,33,33,34,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,58,59,60,62,63,65,67,68,70,71,73,75,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,141,143,145,147,149,151,153,155,157,159,162,164,166,168,170,172,174,176,178,180,182,184,186,187,189,191,193,195,197,198,200,202,204,205,207,209,210,212,213,215,216,218,219,221,222,223,225,226,227,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,243,244,245,246,246,247,247,248,249,249,250,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,11,11,11,12,12,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,22,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,83,85,87,89,91,93,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,131,133,135,137,139,141,143,145,147,149,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,197,199,201,203,204,206,208,209,211,213,214,216,217,219,220,221,223,224,225,227,228,229,230,232,233,234,235,236,237,238,239,240,241,241,242,243,244,245,245,246,247,247,248,248,249,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,8,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,20,20,21,22,23,23,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,51,53,54,55,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,86,87,89,91,93,95,97,99,100,102,104,106,108,110,112,114,116,118,121,123,125,127,129,131,133,135,137,139,142,144,146,148,150,152,154,156,158,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,194,196,198,200,202,203,205,207,208,210,212,213,215,216,218,219,221,222,223,225,226,227,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,244,245,246,246,247,248,248,249,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,16,16,17,17,18,19,19,20,21,21,22,23,24,24,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,41,42,43,44,45,46,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,71,72,74,75,77,79,81,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,134,136,138,140,142,144,146,148,151,153,155,157,159,161,163,165,167,169,172,174,176,178,180,182,184,186,187,189,191,193,195,197,199,200,202,204,206,207,209,211,212,214,215,217,218,220,221,223,224,225,227,228,229,230,232,233,234,235,236,237,238,239,240,241,242,243,243,244,245,246,246,247,247,248,249,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,22,22,23,24,25,25,26,27,28,29,30,31,31,32,33,34,35,36,37,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,69,71,72,74,76,77,79,81,83,84,86,88,90,92,94,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,126,128,130,132,134,136,138,140,143,145,147,149,151,153,155,157,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,199,201,203,205,206,208,210,211,213,215,216,218,219,221,222,223,225,226,227,229,230,231,232,233,235,236,237,238,239,240,240,241,242,243,244,245,245,246,247,247,248,248,249,250,250,251,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,20,20,21,22,22,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,86,88,90,92,94,96,98,100,102,104,105,107,109,112,114,116,118,120,122,124,126,128,130,132,134,137,139,141,143,145,147,149,152,154,156,158,160,162,164,166,169,171,173,175,177,179,181,183,185,187,189,191,193,195,196,198,200,202,204,205,207,209,210,212,214,215,217,218,220,221,223,224,225,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,244,244,245,246,246,247,248,248,249,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,10,10,11,11,11,12,12,13,13,14,14,15,16,16,17,17,18,19,19,20,21,21,22,23,23,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,65,67,68,70,71,73,75,76,78,80,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,129,131,133,135,137,139,141,144,146,148,150,152,154,156,159,161,163,165,167,169,171,173,175,177,179,182,184,186,187,189,191,193,195,197,199,201,203,204,206,208,209,211,213,214,216,217,219,220,222,223,225,226,227,229,230,231,232,234,235,236,237,238,239,240,241,242,242,243,244,245,246,246,247,248,248,249,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,51,52,54,55,56,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,83,85,87,89,91,93,95,96,98,100,102,104,106,108,110,112,114,116,118,121,123,125,127,129,131,133,135,138,140,142,144,146,148,151,153,155,157,159,161,163,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,201,203,205,207,208,210,212,213,215,217,218,220,221,223,224,225,227,228,229,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,245,246,247,247,248,249,249,250,250,251,251,251,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,47,49,50,51,53,54,55,57,58,60,61,62,64,66,67,69,70,72,73,75,77,79,80,82,84,86,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,132,134,136,138,140,142,145,147,149,151,153,155,158,160,162,164,166,168,170,172,175,177,179,181,183,185,187,189,191,193,195,197,198,200,202,204,206,207,209,211,213,214,216,217,219,220,222,223,225,226,227,229,230,231,232,234,235,236,237,238,239,240,241,242,243,244,244,245,246,247,247,248,248,249,250,250,251,251,251,252,252,253,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,15,15,16,17,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,29,30,31,32,32,33,34,35,36,37,38,40,41,42,43,44,45,46,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,86,88,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,126,128,130,132,134,136,138,141,143,145,147,149,152,154,156,158,160,162,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,206,208,210,212,213,215,216,218,220,221,223,224,225,227,228,229,231,232,233,234,235,237,238,239,240,241,241,242,243,244,245,246,246,247,248,248,249,249,250,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,12,12,12,13,13,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,59,60,61,63,64,66,67,69,71,72,74,76,77,79,81,82,84,86,88,90,92,93,95,97,99,101,103,105,107,109,111,113,115,117,120,122,124,126,128,130,132,135,137,139,141,143,145,148,150,152,154,156,159,161,163,165,167,169,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,205,207,209,211,212,214,216,217,219,220,222,223,225,226,227,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,245,246,247,247,248,249,249,250,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,129,131,133,135,137,139,142,144,146,148,150,153,155,157,159,161,164,166,168,170,172,174,176,179,181,183,185,187,189,191,193,195,197,199,201,202,204,206,208,210,211,213,215,216,218,219,221,222,224,225,227,228,229,231,232,233,234,236,237,238,239,240,241,242,243,244,244,245,246,247,247,248,249,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,21,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,87,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,125,127,129,131,133,135,138,140,142,144,146,149,151,153,155,158,160,162,164,166,168,171,173,175,177,179,181,183,185,187,190,192,194,195,197,199,201,203,205,207,209,210,212,214,215,217,219,220,222,223,225,226,228,229,230,231,233,234,235,236,237,238,239,240,241,242,243,244,245,246,246,247,248,248,249,250,250,251,251,252,252,252,253,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,12,12,12,13,13,14,14,15,15,16,17,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,48,50,51,52,54,55,56,58,59,60,62,63,65,67,68,70,71,73,75,76,78,80,81,83,85,87,89,91,92,94,96,98,100,102,104,106,108,110,112,114,116,119,121,123,125,127,129,132,134,136,138,140,143,145,147,149,151,154,156,158,160,162,165,167,169,171,173,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,207,209,211,213,214,216,218,219,221,222,224,225,227,228,230,231,232,233,235,236,237,238,239,240,241,242,243,244,245,245,246,247,248,248,249,249,250,250,251,251,252,252,253,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,65,67,68,70,71,73,75,76,78,80,82,83,85,87,89,91,93,95,96,98,100,102,104,106,108,111,113,115,117,119,121,123,125,128,130,132,134,136,139,141,143,145,147,150,152,154,156,159,161,163,165,167,170,172,174,176,178,180,183,185,187,189,191,193,195,197,199,201,203,205,206,208,210,212,214,215,217,218,220,222,223,225,226,228,229,230,232,233,234,235,236,238,239,240,241,242,243,243,244,245,246,247,247,248,249,249,250,250,251,251,252,252,253,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,31,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,47,49,50,51,52,54,55,57,58,59,61,62,64,65,67,68,70,72,73,75,77,78,80,82,84,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,124,126,128,130,132,135,137,139,141,143,146,148,150,152,155,157,159,161,164,166,168,170,172,175,177,179,181,183,185,187,190,192,194,196,198,200,202,203,205,207,209,211,213,214,216,218,219,221,222,224,225,227,228,230,231,232,234,235,236,237,238,239,240,241,242,243,244,245,246,246,247,248,249,249,250,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,31,32,32,33,34,35,36,37,38,39,41,42,43,44,45,46,48,49,50,51,53,54,55,57,58,59,61,62,64,65,67,69,70,72,73,75,77,79,80,82,84,86,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,120,122,124,126,128,131,133,135,137,139,142,144,146,148,151,153,155,157,160,162,164,166,169,171,173,175,177,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,213,215,217,218,220,222,223,225,226,228,229,230,232,233,234,235,237,238,239,240,241,242,243,244,245,245,246,247,248,248,249,250,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,21,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,53,54,55,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,86,88,90,91,93,95,97,99,101,103,105,107,109,111,114,116,118,120,122,124,127,129,131,133,135,138,140,142,144,147,149,151,153,156,158,160,163,165,167,169,172,174,176,178,180,182,185,187,189,191,193,195,197,199,201,203,205,207,209,210,212,214,216,217,219,221,222,224,225,227,228,230,231,232,234,235,236,237,238,240,241,242,243,243,244,245,246,247,247,248,249,249,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,13,14,14,15,15,16,17,17,18,18,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,81,82,84,86,88,90,92,94,95,97,99,101,103,105,108,110,112,114,116,118,120,122,125,127,129,131,134,136,138,140,143,145,147,149,152,154,156,159,161,163,165,168,170,172,174,177,179,181,183,185,187,190,192,194,196,198,200,202,204,206,208,209,211,213,215,217,218,220,222,223,225,226,228,229,230,232,233,234,236,237,238,239,240,241,242,243,244,245,246,247,247,248,249,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,71,72,74,76,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,121,123,125,127,129,132,134,136,138,141,143,145,148,150,152,155,157,159,161,164,166,168,170,173,175,177,179,182,184,186,188,190,192,194,197,199,201,203,205,206,208,210,212,214,216,217,219,221,222,224,225,227,228,230,231,233,234,235,236,238,239,240,241,242,243,244,245,246,246,247,248,249,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,58,60,61,63,64,66,67,69,71,72,74,76,77,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,117,119,121,123,125,128,130,132,134,137,139,141,143,146,148,150,153,155,157,160,162,164,167,169,171,173,176,178,180,182,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,216,218,220,221,223,225,226,228,229,231,232,233,235,236,237,238,239,240,242,243,243,244,245,246,247,248,248,249,250,250,251,251,252,252,253,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,10,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,52,53,54,56,57,59,60,61,63,64,66,68,69,71,72,74,76,78,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,113,115,117,119,121,123,126,128,130,132,135,137,139,142,144,146,149,151,153,156,158,160,163,165,167,169,172,174,176,179,181,183,185,187,190,192,194,196,198,200,202,204,206,208,210,212,214,215,217,219,221,222,224,225,227,228,230,231,233,234,235,237,238,239,240,241,242,243,244,245,246,247,247,248,249,249,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,54,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,87,89,90,92,94,96,98,100,102,104,106,109,111,113,115,117,119,122,124,126,128,131,133,135,137,140,142,144,147,149,151,154,156,158,161,163,165,168,170,172,175,177,179,181,184,186,188,190,192,195,197,199,201,203,205,207,209,211,213,214,216,218,220,221,223,225,226,228,229,231,232,233,235,236,237,239,240,241,242,243,244,245,246,246,247,248,249,249,250,251,251,252,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,79,81,83,85,87,89,91,92,94,96,98,100,102,105,107,109,111,113,115,117,120,122,124,126,129,131,133,136,138,140,142,145,147,150,152,154,157,159,161,164,166,168,171,173,175,178,180,182,184,187,189,191,193,195,197,200,202,204,206,208,210,212,213,215,217,219,221,222,224,225,227,229,230,232,233,234,236,237,238,239,240,241,242,243,244,245,246,247,248,248,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,13,14,14,15,15,16,16,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,80,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,118,120,122,124,127,129,131,134,136,138,141,143,145,148,150,152,155,157,159,162,164,167,169,171,174,176,178,181,183,185,187,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,221,223,225,226,228,229,231,232,234,235,236,238,239,240,241,242,243,244,245,246,247,248,248,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,14,15,15,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,80,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,114,116,118,120,122,125,127,129,132,134,136,139,141,143,146,148,150,153,155,158,160,162,165,167,170,172,174,177,179,181,183,186,188,190,192,195,197,199,201,203,205,207,209,211,213,215,217,219,220,222,224,226,227,229,230,232,233,234,236,237,238,240,241,242,243,244,245,246,247,247,248,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,105,107,109,112,114,116,118,120,123,125,127,130,132,134,137,139,141,144,146,149,151,153,156,158,161,163,165,168,170,172,175,177,180,182,184,186,189,191,193,195,198,200,202,204,206,208,210,212,214,216,218,220,221,223,225,226,228,229,231,232,234,235,237,238,239,240,241,242,243,244,245,246,247,248,249,249,250,251,251,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,70,71,73,75,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,105,107,110,112,114,116,118,121,123,125,128,130,132,135,137,139,142,144,147,149,151,154,156,159,161,164,166,168,171,173,176,178,180,183,185,187,189,192,194,196,198,201,203,205,207,209,211,213,215,217,219,220,222,224,226,227,229,230,232,233,235,236,237,239,240,241,242,243,244,245,246,247,248,248,249,250,250,251,252,252,253,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,70,71,73,75,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,105,108,110,112,114,116,119,121,123,126,128,130,133,135,137,140,142,145,147,149,152,154,157,159,162,164,166,169,171,174,176,179,181,183,186,188,190,193,195,197,199,201,204,206,208,210,212,214,216,218,219,221,223,225,226,228,230,231,233,234,235,237,238,239,241,242,243,244,245,246,247,247,248,249,250,250,251,251,252,252,253,253,254,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,57,59,60,62,63,65,66,68,70,71,73,75,76,78,80,82,83,85,87,89,91,93,95,97,99,101,103,106,108,110,112,114,117,119,121,123,126,128,131,133,135,138,140,143,145,147,150,152,155,157,160,162,165,167,170,172,174,177,179,182,184,186,189,191,193,196,198,200,202,204,206,209,211,213,215,217,218,220,222,224,226,227,229,230,232,233,235,236,238,239,240,241,242,244,245,245,246,247,248,249,250,250,251,251,252,252,253,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,54,56,57,59,60,62,63,65,66,68,69,71,73,75,76,78,80,82,84,85,87,89,91,93,95,97,99,101,104,106,108,110,112,115,117,119,121,124,126,128,131,133,136,138,140,143,145,148,150,153,155,158,160,163,165,168,170,173,175,177,180,182,185,187,189,192,194,196,199,201,203,205,207,209,211,213,215,217,219,221,223,225,226,228,230,231,233,234,236,237,238,240,241,242,243,244,245,246,247,248,249,249,250,251,251,252,252,253,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,26,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,69,71,73,75,76,78,80,82,84,85,87,89,91,93,95,97,99,102,104,106,108,110,112,115,117,119,122,124,126,129,131,134,136,138,141,143,146,148,151,153,156,158,161,163,166,168,171,173,176,178,181,183,185,188,190,193,195,197,199,202,204,206,208,210,212,214,216,218,220,222,224,226,227,229,231,232,234,235,237,238,239,240,242,243,244,245,246,247,248,248,249,250,251,251,252,252,253,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,59,60,62,63,65,66,68,69,71,73,74,76,78,80,82,84,85,87,89,91,93,95,97,99,102,104,106,108,110,113,115,117,119,122,124,127,129,131,134,136,139,141,144,146,149,151,154,156,159,161,164,166,169,171,174,176,179,181,184,186,189,191,193,196,198,200,202,205,207,209,211,213,215,217,219,221,223,225,226,228,230,231,233,235,236,237,239,240,241,242,244,245,246,247,247,248,249,250,250,251,252,252,253,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,58,60,61,63,64,66,68,69,71,73,74,76,78,80,82,83,85,87,89,91,93,95,97,100,102,104,106,108,110,113,115,117,120,122,124,127,129,132,134,137,139,142,144,147,149,152,154,157,159,162,164,167,169,172,174,177,179,182,184,187,189,192,194,196,199,201,203,206,208,210,212,214,216,218,220,222,224,226,227,229,231,232,234,235,237,238,240,241,242,243,244,245,246,247,248,249,250,250,251,252,252,253,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,53,54,56,57,58,60,61,63,64,66,68,69,71,73,74,76,78,80,82,83,85,87,89,91,93,95,97,100,102,104,106,108,111,113,115,117,120,122,125,127,129,132,134,137,139,142,144,147,150,152,155,157,160,162,165,167,170,173,175,178,180,183,185,188,190,192,195,197,200,202,204,206,209,211,213,215,217,219,221,223,225,227,228,230,232,233,235,236,238,239,240,242,243,244,245,246,247,248,249,249,250,251,251,252,252,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,22,23,24,25,25,26,27,28,28,29,30,31,32,33,34,34,35,36,37,38,39,41,42,43,44,45,46,48,49,50,51,53,54,55,57,58,60,61,63,64,66,67,69,71,72,74,76,78,80,81,83,85,87,89,91,93,95,97,100,102,104,106,108,111,113,115,118,120,122,125,127,130,132,135,137,140,142,145,147,150,153,155,158,160,163,165,168,171,173,176,178,181,183,186,188,191,193,196,198,200,203,205,207,209,212,214,216,218,220,222,224,226,227,229,231,233,234,236,237,239,240,241,242,244,245,246,247,248,248,249,250,251,251,252,252,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,38,39,40,42,43,44,45,46,47,49,50,51,52,54,55,57,58,60,61,63,64,66,67,69,71,72,74,76,78,80,81,83,85,87,89,91,93,95,97,100,102,104,106,108,111,113,115,118,120,123,125,127,130,132,135,137,140,143,145,148,150,153,156,158,161,163,166,169,171,174,176,179,182,184,187,189,192,194,196,199,201,204,206,208,210,213,215,217,219,221,223,225,227,228,230,232,233,235,237,238,239,241,242,243,244,245,246,247,248,249,250,251,251,252,252,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,15,16,16,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,66,67,69,71,72,74,76,78,79,81,83,85,87,89,91,93,95,97,100,102,104,106,108,111,113,115,118,120,123,125,128,130,133,135,138,140,143,146,148,151,153,156,159,161,164,167,169,172,174,177,180,182,185,187,190,192,195,197,200,202,204,207,209,211,214,216,218,220,222,224,226,228,229,231,233,234,236,237,239,240,242,243,244,245,246,247,248,249,250,250,251,252,252,253,253,254,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,56,58,59,61,62,64,65,67,69,70,72,74,76,77,79,81,83,85,87,89,91,93,95,97,100,102,104,106,109,111,113,116,118,120,123,125,128,130,133,135,138,141,143,146,148,151,154,156,159,162,164,167,170,172,175,178,180,183,186,188,191,193,196,198,201,203,205,208,210,212,214,217,219,221,223,225,227,228,230,232,234,235,237,238,240,241,242,244,245,246,247,248,249,250,250,251,252,252,253,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,26,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,58,59,61,62,64,65,67,68,70,72,74,75,77,79,81,83,85,87,89,91,93,95,97,99,102,104,106,109,111,113,116,118,120,123,125,128,131,133,136,138,141,144,146,149,152,154,157,160,162,165,168,170,173,176,178,181,184,186,189,191,194,197,199,201,204,206,209,211,213,215,218,220,222,224,226,228,229,231,233,235,236,238,239,241,242,243,244,246,247,248,248,249,250,251,251,252,253,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,53,54,56,57,59,60,62,63,65,67,68,70,72,73,75,77,79,81,83,85,87,89,91,93,95,97,99,102,104,106,109,111,113,116,118,121,123,126,128,131,133,136,139,141,144,147,149,152,155,157,160,163,165,168,171,174,176,179,182,184,187,190,192,195,197,200,202,205,207,210,212,214,216,219,221,223,225,227,229,230,232,234,236,237,239,240,241,243,244,245,246,247,248,249,250,251,251,252,253,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,28,29,30,31,32,33,34,34,35,36,37,38,40,41,42,43,44,45,46,48,49,50,51,53,54,56,57,59,60,62,63,65,66,68,70,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,102,104,106,108,111,113,116,118,121,123,126,128,131,133,136,139,141,144,147,150,152,155,158,161,163,166,169,172,174,177,180,182,185,188,190,193,196,198,201,203,206,208,210,213,215,217,220,222,224,226,228,230,231,233,235,237,238,240,241,242,244,245,246,247,248,249,250,251,251,252,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,51,53,54,55,57,58,60,61,63,64,66,68,69,71,73,75,77,79,80,82,84,86,88,90,93,95,97,99,101,104,106,108,111,113,116,118,121,123,126,128,131,134,136,139,142,144,147,150,153,155,158,161,164,167,169,172,175,178,180,183,186,189,191,194,196,199,202,204,207,209,211,214,216,218,221,223,225,227,229,231,232,234,236,237,239,240,242,243,244,246,247,248,249,250,250,251,252,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,57,58,59,61,63,64,66,68,69,71,73,75,76,78,80,82,84,86,88,90,92,95,97,99,101,104,106,108,111,113,116,118,121,123,126,129,131,134,137,139,142,145,147,150,153,156,159,161,164,167,170,173,176,178,181,184,187,189,192,195,197,200,203,205,208,210,212,215,217,219,222,224,226,228,230,232,233,235,237,238,240,241,243,244,245,246,248,249,249,250,251,252,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,51,52,53,55,56,58,59,61,62,64,66,67,69,71,72,74,76,78,80,82,84,86,88,90,92,94,97,99,101,104,106,108,111,113,116,118,121,123,126,129,131,134,137,139,142,145,148,151,153,156,159,162,165,168,170,173,176,179,182,185,187,190,193,196,198,201,203,206,209,211,213,216,218,220,223,225,227,229,231,233,234,236,238,239,241,242,244,245,246,247,248,249,250,251,252,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,22,23,24,25,25,26,27,28,28,29,30,31,32,33,33,34,35,36,37,38,39,41,42,43,44,45,46,48,49,50,52,53,54,56,57,59,60,62,64,65,67,69,70,72,74,76,78,80,82,84,86,88,90,92,94,96,99,101,103,106,108,111,113,116,118,121,123,126,129,131,134,137,140,142,145,148,151,154,157,160,162,165,168,171,174,177,180,183,185,188,191,194,196,199,202,204,207,210,212,214,217,219,221,224,226,228,230,232,234,235,237,239,240,242,243,245,246,247,248,249,250,251,251,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,26,27,28,29,30,31,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,51,53,54,55,57,58,60,62,63,65,67,68,70,72,74,75,77,79,81,83,85,87,90,92,94,96,98,101,103,106,108,110,113,116,118,121,123,126,129,131,134,137,140,143,145,148,151,154,157,160,163,166,169,172,175,177,180,183,186,189,192,195,197,200,203,205,208,211,213,215,218,220,223,225,227,229,231,233,235,237,238,240,241,243,244,245,247,248,249,250,251,251,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,50,51,52,54,55,57,58,60,61,63,64,66,68,70,71,73,75,77,79,81,83,85,87,89,91,94,96,98,101,103,105,108,110,113,115,118,121,123,126,129,132,134,137,140,143,146,149,152,154,157,160,163,166,169,172,175,178,181,184,187,190,193,195,198,201,204,206,209,212,214,217,219,221,224,226,228,230,232,234,236,238,239,241,242,244,245,246,247,249,250,250,251,252,253,253,254,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,33,33,34,35,36,37,38,40,41,42,43,44,45,47,48,49,50,52,53,55,56,58,59,61,62,64,66,67,69,71,73,75,77,79,81,83,85,87,89,91,93,96,98,100,103,105,108,110,113,115,118,121,123,126,129,132,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,193,196,199,202,205,207,210,213,215,218,220,222,225,227,229,231,233,235,237,239,240,242,243,245,246,247,248,249,250,251,252,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,16,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,49,50,51,53,54,56,57,59,60,62,64,65,67,69,71,72,74,76,78,80,82,84,86,89,91,93,95,98,100,102,105,107,110,113,115,118,121,123,126,129,132,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194,197,200,203,206,208,211,214,216,219,221,224,226,228,230,232,234,236,238,240,241,243,244,246,247,248,249,250,251,252,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,50,51,52,54,55,57,58,60,61,63,65,67,68,70,72,74,76,78,80,82,84,86,88,90,93,95,97,100,102,105,107,110,112,115,118,120,123,126,129,132,135,137,140,143,146,149,152,155,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,209,212,215,217,220,222,225,227,229,231,233,235,237,239,241,242,244,245,247,248,249,250,251,252,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,48,49,50,52,53,55,56,58,59,61,63,64,66,68,70,71,73,75,77,79,81,83,86,88,90,92,95,97,99,102,104,107,109,112,115,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,175,178,181,184,187,190,193,196,199,202,205,208,210,213,216,218,221,223,226,228,230,232,235,236,238,240,242,243,245,246,247,249,250,251,251,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,27,28,29,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,49,50,51,53,54,56,57,59,60,62,64,65,67,69,71,73,75,77,79,81,83,85,87,90,92,94,97,99,101,104,107,109,112,115,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,166,169,172,175,178,181,185,188,191,194,197,200,203,206,209,212,214,217,220,222,225,227,229,232,234,236,238,239,241,243,244,246,247,248,249,250,251,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,32,33,34,35,36,37,38,40,41,42,43,44,45,47,48,49,51,52,54,55,57,58,60,61,63,65,67,68,70,72,74,76,78,80,82,85,87,89,91,94,96,99,101,104,106,109,112,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,160,163,166,169,173,176,179,182,185,189,192,195,198,201,204,207,210,213,215,218,221,223,226,228,230,233,235,237,239,241,242,244,245,247,248,249,250,251,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,49,50,52,53,55,56,58,59,61,63,64,66,68,70,72,74,76,78,80,82,84,86,89,91,93,96,98,101,103,106,108,111,114,117,120,123,125,128,131,134,138,141,144,147,150,153,157,160,163,167,170,173,176,180,183,186,189,193,196,199,202,205,208,211,214,217,219,222,225,227,229,232,234,236,238,240,242,243,245,246,248,249,250,251,252,253,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,16,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,26,27,28,29,30,31,31,32,33,34,35,36,37,38,40,41,42,43,44,46,47,48,50,51,52,54,55,57,59,60,62,64,65,67,69,71,73,75,77,79,81,83,86,88,90,93,95,98,100,103,105,108,111,114,116,119,122,125,128,131,134,138,141,144,147,150,154,157,160,164,167,170,174,177,180,184,187,190,193,197,200,203,206,209,212,215,218,221,223,226,228,231,233,235,237,239,241,243,244,246,247,249,250,251,252,252,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,10,11,11,12,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,22,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,48,49,50,52,53,55,56,58,60,61,63,65,67,68,70,72,74,76,78,81,83,85,87,90,92,95,97,100,102,105,108,110,113,116,119,122,125,128,131,134,137,141,144,147,151,154,157,161,164,167,171,174,178,181,184,188,191,194,198,201,204,207,210,213,216,219,222,224,227,230,232,234,236,238,240,242,244,246,247,248,249,251,251,252,253,254,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,26,26,27,28,29,30,30,31,32,33,34,35,36,37,38,39,41,42,43,44,46,47,48,50,51,53,54,56,57,59,60,62,64,66,68,70,72,74,76,78,80,82,84,87,89,91,94,96,99,102,104,107,110,113,116,119,122,125,128,131,134,137,141,144,147,151,154,157,161,164,168,171,175,178,182,185,189,192,195,199,202,205,208,211,214,217,220,223,226,228,231,233,235,238,240,242,243,245,247,248,249,250,251,252,253,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,16,17,18,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,49,50,52,53,55,56,58,60,61,63,65,67,69,71,73,75,77,79,81,84,86,88,91,93,96,98,101,104,107,109,112,115,118,121,124,128,131,134,137,141,144,147,151,154,158,161,165,168,172,175,179,182,186,189,193,196,200,203,206,209,213,216,219,222,224,227,230,232,235,237,239,241,243,245,246,248,249,250,251,252,253,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,22,22,23,24,25,25,26,27,28,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,47,48,50,51,52,54,56,57,59,61,62,64,66,68,70,72,74,76,78,81,83,85,88,90,93,95,98,100,103,106,109,112,115,118,121,124,127,131,134,137,141,144,147,151,154,158,162,165,169,172,176,180,183,187,190,194,197,201,204,207,211,214,217,220,223,226,228,231,233,236,238,240,242,244,246,247,249,250,251,252,253,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,23,24,25,25,26,27,28,29,30,30,31,32,33,34,35,36,37,38,40,41,42,43,45,46,47,49,50,52,53,55,56,58,60,62,63,65,67,69,71,73,75,77,80,82,84,87,89,92,94,97,100,103,105,108,111,114,117,120,124,127,130,134,137,140,144,147,151,155,158,162,165,169,173,176,180,184,187,191,195,198,202,205,209,212,215,218,221,224,227,230,232,235,237,239,241,243,245,247,248,250,251,252,253,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,23,24,25,26,26,27,28,29,30,31,32,33,33,34,36,37,38,39,40,41,42,44,45,46,48,49,51,52,54,55,57,59,61,62,64,66,68,70,72,74,77,79,81,83,86,88,91,94,96,99,102,105,108,111,114,117,120,123,127,130,133,137,140,144,147,151,155,158,162,166,170,173,177,181,185,188,192,196,199,203,206,210,213,216,220,223,226,228,231,234,236,239,241,243,245,246,248,249,251,252,253,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44,46,47,48,50,51,53,54,56,58,60,61,63,65,67,69,71,73,76,78,80,83,85,87,90,93,95,98,101,104,107,110,113,116,119,123,126,129,133,136,140,144,147,151,155,159,162,166,170,174,178,181,185,189,193,197,200,204,207,211,214,218,221,224,227,230,233,235,238,240,242,244,246,248,249,250,251,252,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,26,27,27,28,29,30,31,32,33,34,35,36,37,38,40,41,42,43,45,46,47,49,50,52,53,55,57,59,60,62,64,66,68,70,72,75,77,79,82,84,87,89,92,94,97,100,103,106,109,112,116,119,122,126,129,133,136,140,143,147,151,155,159,163,166,170,174,178,182,186,190,194,198,201,205,209,212,216,219,222,225,228,231,234,237,239,241,243,245,247,249,250,251,252,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,35,36,37,39,40,41,42,44,45,46,48,49,51,52,54,56,57,59,61,63,65,67,69,71,73,76,78,80,83,85,88,91,94,96,99,102,105,108,112,115,118,122,125,129,132,136,140,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,206,210,214,217,221,224,227,230,233,236,238,241,243,245,247,248,250,251,252,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,35,36,38,39,40,41,43,44,45,47,48,50,51,53,55,56,58,60,62,64,66,68,70,72,75,77,79,82,84,87,90,92,95,98,101,104,107,111,114,117,121,124,128,132,135,139,143,147,151,155,159,163,167,171,175,179,184,188,192,196,200,204,208,211,215,219,222,225,229,232,234,237,240,242,244,246,248,249,251,252,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,24,25,26,27,28,29,29,30,31,32,33,34,35,37,38,39,40,42,43,44,46,47,49,50,52,53,55,57,59,61,63,65,67,69,71,73,76,78,81,83,86,88,91,94,97,100,103,106,110,113,117,120,124,127,131,135,139,143,147,151,155,159,163,167,172,176,180,184,188,193,197,201,205,209,213,216,220,224,227,230,233,236,239,241,243,246,247,249,251,252,253,254,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,10,11,11,12,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,21,22,23,24,24,25,26,27,28,29,29,30,31,32,33,34,36,37,38,39,40,42,43,44,46,47,49,51,52,54,56,57,59,61,63,65,67,70,72,74,77,79,82,84,87,90,93,96,99,102,105,109,112,116,119,123,127,130,134,138,142,146,151,155,159,163,168,172,176,181,185,189,194,198,202,206,210,214,218,222,225,229,232,235,238,240,243,245,247,249,250,252,253,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,21,21,22,23,24,24,25,26,27,28,28,29,30,31,32,33,34,36,37,38,39,40,42,43,45,46,48,49,51,53,54,56,58,60,62,64,66,68,71,73,75,78,80,83,86,89,92,95,98,101,104,108,111,115,118,122,126,130,134,138,142,146,150,155,159,163,168,172,177,181,186,190,195,199,203,207,212,216,219,223,227,230,233,236,239,242,244,246,248,250,251,252,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,15,16,16,17,18,18,19,19,20,21,21,22,23,23,24,25,26,27,27,28,29,30,31,32,33,34,36,37,38,39,41,42,43,45,46,48,49,51,53,55,56,58,60,62,65,67,69,71,74,76,79,82,84,87,90,93,96,100,103,106,110,114,117,121,125,129,133,137,141,146,150,155,159,164,168,173,177,182,187,191,196,200,205,209,213,217,221,225,228,232,235,238,241,244,246,248,250,251,252,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,19,19,20,20,21,22,22,23,24,25,26,26,27,28,29,30,31,32,33,34,36,37,38,39,41,42,43,45,46,48,50,51,53,55,57,59,61,63,65,67,70,72,75,77,80,83,86,89,92,95,98,102,105,109,112,116,120,124,128,132,137,141,145,150,154,159,164,168,173,178,183,187,192,197,201,206,210,215,219,223,227,230,234,237,240,243,245,247,249,251,252,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,25,25,26,27,28,29,30,31,32,33,34,35,37,38,39,41,42,43,45,46,48,50,52,53,55,57,59,61,64,66,68,71,73,76,78,81,84,87,90,93,97,100,104,107,111,115,119,123,127,131,136,140,145,149,154,159,164,169,173,178,183,188,193,198,203,207,212,216,220,225,228,232,236,239,242,244,247,249,251,252,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,13,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,42,43,45,46,48,50,52,54,55,57,60,62,64,66,69,71,74,77,79,82,85,88,92,95,99,102,106,110,114,118,122,126,130,135,139,144,149,154,159,164,169,174,179,184,189,194,199,204,209,213,218,222,226,230,234,237,241,244,246,248,250,252,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,20,21,22,22,23,24,25,26,26,27,28,29,30,31,33,34,35,36,37,39,40,42,43,45,46,48,50,52,54,56,58,60,62,64,67,69,72,75,77,80,83,87,90,93,97,100,104,108,112,116,120,125,129,134,139,143,148,153,158,164,169,174,179,185,190,195,200,205,210,215,220,224,228,232,236,239,243,245,248,250,251,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,24,24,25,26,27,28,29,30,31,32,33,35,36,37,39,40,41,43,45,46,48,50,52,54,56,58,60,62,65,67,70,73,75,78,81,85,88,91,95,98,102,106,110,115,119,123,128,133,138,143,148,153,158,164,169,174,180,185,191,196,202,207,212,217,222,226,230,234,238,241,244,247,249,251,253,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,17,18,19,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,40,41,43,44,46,48,50,52,54,56,58,60,63,65,68,70,73,76,79,82,86,89,93,96,100,104,108,113,117,122,127,131,136,142,147,152,158,163,169,175,180,186,192,197,203,208,214,219,224,228,233,237,240,243,246,249,251,252,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,23,23,24,25,26,27,28,29,30,31,32,34,35,36,38,39,41,42,44,46,47,49,51,53,56,58,60,63,65,68,71,74,77,80,83,87,90,94,98,102,106,111,115,120,125,130,135,141,146,152,157,163,169,175,181,187,193,199,204,210,215,221,226,230,235,239,242,246,248,251,252,254,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,23,24,24,25,26,27,28,29,31,32,33,34,36,37,39,40,42,43,45,47,49,51,53,55,58,60,63,65,68,71,74,77,81,84,88,92,96,100,104,109,113,118,123,128,134,139,145,151,157,163,169,175,181,188,194,200,206,212,217,223,228,233,237,241,245,248,250,252,253,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,38,39,41,43,45,47,49,51,53,55,58,60,63,65,68,71,75,78,81,85,89,93,97,102,106,111,116,121,127,132,138,144,150,156,162,169,175,182,188,195,201,208,214,220,225,230,235,240,243,247,250,252,253,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,11,12,12,13,13,14,14,15,15,16,16,17,18,18,19,20,20,21,22,23,24,25,26,27,28,29,30,31,33,34,36,37,39,40,42,44,46,48,50,52,55,57,60,63,65,68,72,75,78,82,86,90,94,99,104,108,114,119,124,130,136,142,149,155,162,169,175,182,189,196,203,209,216,222,228,233,238,242,246,249,251,253,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,12,13,13,14,14,15,16,16,17,17,18,19,20,20,21,22,23,24,25,26,27,28,29,31,32,33,35,36,38,39,41,43,45,47,49,52,54,57,59,62,65,68,72,75,79,83,87,91,96,101,106,111,116,122,128,134,141,147,154,161,168,176,183,190,197,204,211,218,224,230,236,241,245,248,251,253,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,14,14,15,15,16,17,17,18,19,19,20,21,22,23,24,25,26,27,28,29,31,32,34,35,37,38,40,42,44,46,48,51,53,56,59,62,65,68,72,75,79,83,88,92,97,102,108,113,119,126,132,139,146,153,160,168,176,183,191,199,206,214,221,227,233,239,243,247,250,253,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,14,14,15,16,16,17,18,18,19,20,21,22,23,24,25,26,27,28,29,31,32,34,35,37,39,41,43,45,47,50,52,55,58,61,64,68,71,75,80,84,89,94,99,104,110,116,123,129,137,144,152,159,167,176,184,192,200,208,216,223,230,236,242,246,250,252,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,9,10,10,10,11,11,12,12,13,13,14,14,15,16,16,17,18,19,19,20,21,22,23,24,26,27,28,29,31,32,34,36,37,39,41,44,46,48,51,54,57,60,64,67,71,75,80,84,89,95,100,106,113,119,126,134,142,150,158,167,175,184,193,202,211,219,226,233,240,245,249,252,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,13,14,14,15,16,17,17,18,19,20,21,22,23,24,25,26,28,29,31,32,34,36,38,40,42,44,47,50,53,56,59,63,66,70,75,80,85,90,96,102,109,116,123,131,139,148,157,166,175,185,194,204,213,222,230,237,243,248,252,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,10,10,11,11,12,12,13,13,14,14,15,16,17,17,18,19,20,21,22,23,25,26,27,29,30,32,34,36,38,40,42,45,48,51,54,57,61,65,70,74,79,85,91,97,104,111,119,127,136,145,155,165,175,185,196,206,216,225,234,241,247,251,254,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,9,9,9,10,10,11,11,12,12,13,14,14,15,16,16,17,18,19,20,21,22,24,25,27,28,30,32,33,36,38,40,43,46,49,52,56,59,64,68,73,79,85,91,98,106,114,122,132,142,152,163,174,186,197,209,219,229,238,245,250,253,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,10,10,11,11,12,12,13,14,15,15,16,17,18,19,20,21,23,24,26,27,29,31,33,35,37,40,43,46,49,53,57,62,67,72,78,84,91,99,108,117,127,138,149,161,174,186,199,212,223,234,243,249,253,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,8,8,9,9,10,10,11,11,12,12,13,14,15,16,17,18,19,20,21,23,24,26,28,30,32,34,37,40,43,46,50,54,59,64,70,76,84,92,100,110,121,132,145,158,172,187,201,215,228,239,247,253,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,9,9,10,10,11,12,12,13,14,15,16,17,18,19,21,22,24,26,28,30,33,36,39,42,46,51,56,61,67,74,82,91,101,113,125,139,154,171,187,204,220,234,245,252,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,5,5,5,6,6,6,7,7,8,8,9,9,10,10,11,12,13,14,15,16,17,19,20,22,24,26,28,31,34,37,41,46,51,57,64,71,80,91,103,116,132,149,168,188,208,226,241,251,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,5,5,5,6,6,7,7,8,8,9,9,10,11,12,13,14,16,17,19,21,23,25,28,31,35,39,45,51,58,67,77,89,104,121,141,164,188,213,234,249,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,6,6,7,7,8,9,10,11,12,13,15,16,18,21,24,27,31,36,42,50,59,71,86,105,128,157,189,221,245,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,8,9,11,13,15,17,20,25,30,37,47,60,79,106,143,189,235,255},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,3,3,4,5,6,8,10,13,18,26,38,62,107,190,255}
};

//查表函数
int LUT_Data(unsigned int average,unsigned int srcpixle)
{
	unsigned int dstpixle;
    dstpixle = Array[average][srcpixle];
	return dstpixle;
}

//计算RGB平均值，目前没有用到
void mppFramProce(IVE_SRC_IMAGE_S *pstSrcImg,int width,int heigh)
{
    static int Ravg = 20;
    static int Gavg = 20;
    static int Bavg = 20;
    unsigned int  sumR = 0 ;
	unsigned int  sumG = 0 ;
	unsigned int  sumB = 0 ;

	unsigned int  Pcount = width * heigh;
	unsigned int  rows = width;
	unsigned int  cols = heigh;
	unsigned char *r,*g,*b;
	r = (unsigned char *)(pstSrcImg->au64VirAddr[0]);
	g = (unsigned char *)(pstSrcImg->au64VirAddr[1]);
	b = (unsigned char *)(pstSrcImg->au64VirAddr[2]);

    for (unsigned int row = 0; row < rows; row++)
    {
    	for (unsigned int col = 0; col < cols; col++)
    	{
			sumR = sumR + r[row*rows+col];
    		sumG = sumG + g[row*rows+col];
    		sumB = sumB + b[row*rows+col];
			unsigned int temp_R = LUT_Data(Ravg,r[row*rows+col]);
			if(temp_R>=255)
				r[row*rows+col] = 255;
			else if(temp_R<=0)
				r[row*rows+col] = 0;
			else
                r[row*rows+col] = temp_R;					//pixel "R"
			unsigned int temp_G = LUT_Data(Gavg,g[row*rows+col]);
			if(temp_G>=255){
				g[row*rows+col] = 255;}
			else if(temp_G<=0){
				g[row*rows+col] = 0;}
			else{
				g[row*rows+col] = temp_G;}					//pixel "G"
			unsigned int temp_B = LUT_Data(Bavg,b[row*rows+col]);
			if(temp_B>=255){
				b[row*rows+col] = 255;}
			else if(temp_B<=0){
				b[row*rows+col] = 0;}
			else{
				b[row*rows+col] = temp_B;}					//pixel "B"
    	}
    }
    Ravg = (sumR/Pcount);
    Gavg = (sumG/Pcount);
    Bavg = (sumB/Pcount);
}



//=======================================================================================================
//结构体定义
typedef struct hiSAMPLE_VENC_GETSTREAM_PARA_S
{
    HI_BOOL bThreadStart;
    VENC_CHN VeChn[VENC_MAX_CHN_NUM];
    HI_S32  s32Cnt;
    char path[50];
    int width;
    int height;
} SAMPLE_VENC_GETSTREAM_PARA_S;

static SAMPLE_VENC_GETSTREAM_PARA_S gs_stPara;
static pthread_t gs_VencPid;

//=======================================================================================================
//获取图片并编码JPEG
HI_S32 mppVencJpeg(VENC_CHN VencChn, HI_U32 SnapCnt,char *path)
{
    struct timeval TimeoutVal;
    fd_set read_fds;
    HI_S32 s32VencFd;
    VENC_CHN_STATUS_S stStat;
    VENC_STREAM_S stStream;
    HI_S32 s32Ret;
    HI_U32 i;
    s32VencFd = HI_MPI_VENC_GetFd(VencChn);
    if (s32VencFd < 0)
    {
        SAMPLE_PRT("HI_MPI_VENC_GetFd faild with%#x!\n", s32VencFd);
        return HI_FAILURE;
    }
    for(i=0; i<SnapCnt; i++)
    {
        FD_ZERO(&read_fds);
        FD_SET(s32VencFd, &read_fds);
        TimeoutVal.tv_sec  = 1;
        TimeoutVal.tv_usec = 0;
        s32Ret = select(s32VencFd + 1, &read_fds, NULL, NULL, &TimeoutVal);//获取VENC通道里的数据，超时了一般就是没有数据
        if (s32Ret < 0)
        {
            SAMPLE_PRT("snap select failed!\n");
            return HI_FAILURE;
        }
        else if (0 == s32Ret)
        {
            SAMPLE_PRT("snap time out!\n");
            return HI_FAILURE;
        }
        else
        {
            if (FD_ISSET(s32VencFd, &read_fds))
            {
                s32Ret = HI_MPI_VENC_QueryStatus(VencChn, &stStat);//获取VENC状态
                if (s32Ret != HI_SUCCESS)
                {
                    SAMPLE_PRT("HI_MPI_VENC_QueryStatus failed with %#x!\n", s32Ret);
                    return HI_FAILURE;
                }
                /*******************************************************
                suggest to check both u32CurPacks and u32LeftStreamFrames at the same time,for example:
                 if(0 == stStat.u32CurPacks || 0 == stStat.u32LeftStreamFrames)
                 {                SAMPLE_PRT("NOTE: Current  frame is NULL!\n");
                    return HI_SUCCESS;
                 }
                 *******************************************************/
                if (0 == stStat.u32CurPacks)
                {
                    SAMPLE_PRT("NOTE: Current  frame is NULL!\n");
                    return HI_SUCCESS;
                }
                stStream.pstPack = (VENC_PACK_S*)malloc(sizeof(VENC_PACK_S) * stStat.u32CurPacks);//开辟空间留给数据流
                if (NULL == stStream.pstPack)
                {
                    SAMPLE_PRT("malloc memory failed!\n");
                    return HI_FAILURE;
                }
                stStream.u32PackCount = stStat.u32CurPacks;
                s32Ret = HI_MPI_VENC_GetStream(VencChn, &stStream, -1);//获取数据流
                if (HI_SUCCESS != s32Ret)
                {
                    SAMPLE_PRT("HI_MPI_VENC_GetStream failed with %#x!\n", s32Ret);

                    free(stStream.pstPack);
                    stStream.pstPack = NULL;
                    return HI_FAILURE;
                }
                char acFile[FILE_NAME_LEN]    = {0};
                FILE* pFile;
                time_t rawtime;
                struct tm *info;
                time( &rawtime );
                info = localtime( &rawtime );
                snprintf(acFile, FILE_NAME_LEN, "%s/%d-%02d-%02d-%02d-%02d-%02d.jpg", path,
                1900+ info->tm_year,info->tm_mon+1,info->tm_mday,
                info->tm_hour,info->tm_min,info->tm_sec);
                pFile = fopen(acFile, "wb");
                if (pFile == NULL)
                {
                    SAMPLE_PRT("open file err\n");

                    free(stStream.pstPack);
                    stStream.pstPack = NULL;
                    return HI_FAILURE;
                }
                //把数据流写入jpeg文件里
                for (i = 0; i < stStream.u32PackCount; i++)
                {
                    fwrite(stStream.pstPack[i].pu8Addr + stStream.pstPack[i].u32Offset,
                           stStream.pstPack[i].u32Len - stStream.pstPack[i].u32Offset, 1, pFile);
                    fflush(pFile);
                }
                fclose(pFile);
                s32Ret = HI_MPI_VENC_ReleaseStream(VencChn, &stStream);//最后一定要释放数据流
                if (HI_SUCCESS != s32Ret)
                {
                    SAMPLE_PRT("HI_MPI_VENC_ReleaseStream failed with %#x!\n", s32Ret);

                    free(stStream.pstPack);
                    stStream.pstPack = NULL;

                    return HI_FAILURE;
                }

                free(stStream.pstPack);
                stStream.pstPack = NULL;
            }
        }
    }

    return HI_SUCCESS;
}

//=======================================================================================================
//用ffmpeg来编码视频流
HI_VOID* ffmpegEncodeFile(HI_VOID* p)
{
	HI_S32 s32Ret;
    avi_t *out_fd = NULL;
    //FILE* pFile;
	SAMPLE_VENC_GETSTREAM_PARA_S* pstPara;
    struct timeval TimeoutVal;
    fd_set read_fds;
    HI_S32 VencFd;
    //HI_CHAR aszFileName[64];
    HI_CHAR aszMp4Name[64];
    VENC_CHN_STATUS_S stStat;
    VENC_STREAM_S stStream;
    //echo 3 > /proc/sys/vm/drop_caches
    time_t rawtime;
    struct tm *info;
    int i;
    pstPara = (SAMPLE_VENC_GETSTREAM_PARA_S*)p; //通过输入来获取视频的参数
    time( &rawtime );
    info = localtime( &rawtime );
    //snprintf(aszFileName,64, "%s/%d-%02d-%02d-%02d-%02d-%02d%s",gs_stPara.path,
    //1900+ info->tm_year,info->tm_mon+1,info->tm_mday,
    //info->tm_hour,info->tm_min,info->tm_sec,".h265");
    snprintf(aszMp4Name,64, "%s/%d-%02d-%02d-%02d-%02d-%02d%s",gs_stPara.path,
    1900+info->tm_year,info->tm_mon+1,info->tm_mday,
    info->tm_hour,info->tm_min,info->tm_sec,".avi");
    //pFile = fopen(aszFileName, "wb");
    out_fd = AVI_open_output_file(aszMp4Name);

    AVI_set_video(out_fd, pstPara->width, pstPara->height, 25, "hev1");
    //录下的视频播放失败一般就是这里avi的长宽设置错了，或者解码视频的长宽不对

    VencFd = HI_MPI_VENC_GetFd(0);
    while (HI_TRUE == pstPara->bThreadStart)
    {
        FD_ZERO(&read_fds);
        FD_SET(VencFd, &read_fds);
        TimeoutVal.tv_sec  = 2;
        TimeoutVal.tv_usec = 0;
        s32Ret = select(VencFd + 1, &read_fds, NULL, NULL, &TimeoutVal);
        if (s32Ret > 0)
        {
            memset(&stStream, 0, sizeof(stStream));
            s32Ret = HI_MPI_VENC_QueryStatus(0, &stStat);//获取视频流和获取图片的过程一样
            if (HI_SUCCESS != s32Ret)
            {
                SAMPLE_PRT("HI_MPI_VENC_QueryStatus chn[] failed with %#x!\n", s32Ret);
                break;
            }
            if(0 == stStat.u32CurPacks)
            {
                  SAMPLE_PRT("NOTE: Current  frame is NULL!\n");
                  continue;
            }
            stStream.pstPack = (VENC_PACK_S*)malloc(sizeof(VENC_PACK_S) * stStat.u32CurPacks);
            if (NULL == stStream.pstPack)
            {
                SAMPLE_PRT("malloc stream pack failed!\n");
                break;
            }
            stStream.u32PackCount = stStat.u32CurPacks;
            s32Ret = HI_MPI_VENC_GetStream(0, &stStream, HI_TRUE);
            if (HI_SUCCESS != s32Ret)
            {
                free(stStream.pstPack);
                stStream.pstPack = NULL;
                SAMPLE_PRT("HI_MPI_VENC_GetStream failed with %#x!\n", \
                           s32Ret);
                break;
            }
            #if 1
            for (i = 0; i < stStream.u32PackCount; i++)
            {
                AVI_write_frame(out_fd, (char *)(stStream.pstPack[i].pu8Addr + stStream.pstPack[i].u32Offset),
                stStream.pstPack[i].u32Len - stStream.pstPack[i].u32Offset);
                //fwrite(stStream.pstPack[i].pu8Addr + stStream.pstPack[i].u32Offset,
                //       stStream.pstPack[i].u32Len - stStream.pstPack[i].u32Offset, 1, pFile);
                //fflush(pFile);
            }
            #endif
            s32Ret = HI_MPI_VENC_ReleaseStream(0, &stStream);
            if (HI_SUCCESS != s32Ret)
            {
                SAMPLE_PRT("HI_MPI_VENC_ReleaseStream failed!\n");
                free(stStream.pstPack);
                stStream.pstPack = NULL;
                break;
            }
            free(stStream.pstPack);
            stStream.pstPack = NULL;
        }
    }
    AVI_close(out_fd);
    //fclose(pFile);
}

#if 0
//=======================================================================================================
HI_S32 mppVencStart(PAYLOAD_TYPE_E enType,SIZE_S stSize,HI_U32 u32FrameRate,VPSS_CHN VpssChn, VENC_CHN VencChn,
                                HI_U32 u32Profile, HI_BOOL bRcnRefShareBuf,VENC_GOP_ATTR_S *pstGopAttr,char *path)
{
    VENC_RECV_PIC_PARAM_S  stRecvParam;
    VENC_CHN_ATTR_S        stVencChnAttr;
    VENC_ATTR_JPEG_S       stJpegAttr;
    VENC_H265_FIXQP_S      stH265FixQp;
    VENC_MJPEG_FIXQP_S     stMjpegeFixQp;
    MPP_CHN_S stSrcChn;
    MPP_CHN_S stDestChn;
    /******************************************
     step 1:  Create Venc Channel
    ******************************************/
    stVencChnAttr.stVencAttr.enType          = enType;
    stVencChnAttr.stVencAttr.u32MaxPicWidth  = stSize.u32Width;
    stVencChnAttr.stVencAttr.u32MaxPicHeight = stSize.u32Height;
    stVencChnAttr.stVencAttr.u32PicWidth     = stSize.u32Width;/*the picture width*/
    stVencChnAttr.stVencAttr.u32PicHeight    = stSize.u32Height;/*the picture height*/
    stVencChnAttr.stVencAttr.u32BufSize      = stSize.u32Width * stSize.u32Height * 2;/*stream buffer size*/
    stVencChnAttr.stVencAttr.u32Profile      = u32Profile;
    stVencChnAttr.stVencAttr.bByFrame        = HI_TRUE;/*get stream mode is slice mode or frame mode?*/
    switch (enType)
    {
        case PT_H265://H265视频的参数设置
            //OS01A录制的视频:1320*1080尺寸,贞率为:25FPS,码率为:80000Kbps=9.76MB每秒
            stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265FIXQP;
            stH265FixQp.u32Gop              = 30;
            stH265FixQp.u32SrcFrameRate     = u32FrameRate;
            stH265FixQp.fr32DstFrameRate    = u32FrameRate;
            stH265FixQp.u32IQp              = 25;
            stH265FixQp.u32PQp              = 30;
            stH265FixQp.u32BQp              = 32;
            memcpy(&stVencChnAttr.stRcAttr.stH265FixQp, &stH265FixQp, sizeof(VENC_H265_FIXQP_S));
            stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
            memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            break;

        case PT_MJPEG://MJPEG的参数设置，目前没用
            stVencChnAttr.stRcAttr.enRcMode     = VENC_RC_MODE_MJPEGFIXQP;
            stMjpegeFixQp.u32Qfactor            = 95;
            stMjpegeFixQp.u32SrcFrameRate       = u32FrameRate;
            stMjpegeFixQp.fr32DstFrameRate      = u32FrameRate;
            memcpy(&stVencChnAttr.stRcAttr.stMjpegFixQp, &stMjpegeFixQp,sizeof(VENC_MJPEG_FIXQP_S));
            stVencChnAttr.stGopAttr.enGopMode   = VENC_GOPMODE_NORMALP;
            stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta = 0;
            break;

        case PT_JPEG://JPEG的参数设置----拍照
            stJpegAttr.bSupportDCF                              = HI_FALSE;
            stJpegAttr.stMPFCfg.u8LargeThumbNailNum             = 0;
            stJpegAttr.enReceiveMode                            = VENC_PIC_RECEIVE_SINGLE;
            memcpy(&stVencChnAttr.stVencAttr.stAttrJpege, &stJpegAttr, sizeof(VENC_ATTR_JPEG_S));
            stVencChnAttr.stGopAttr.enGopMode                   = VENC_GOPMODE_NORMALP;
            stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta      = 0;
            break;

        default:
            break;
    }
    CHECK_RET(HI_MPI_VENC_CreateChn(VencChn, &stVencChnAttr), "HI_MPI_VENC_CreateChn()");
    stRecvParam.s32RecvPicNum = -1;
    CHECK_RET(HI_MPI_VENC_StartRecvFrame(VencChn,&stRecvParam), "HI_MPI_VENC_StartRecvFrame()");
    stSrcChn.enModId    = HI_ID_VPSS;
    stSrcChn.s32DevId   = 0;
    stSrcChn.s32ChnId   = VpssChn;
    stDestChn.enModId   = HI_ID_VENC;
    stDestChn.s32DevId  = 0;
    stDestChn.s32ChnId  = VencChn;
    CHECK_RET(HI_MPI_SYS_Bind(&stSrcChn, &stDestChn), "HI_MPI_SYS_Bind(VPSS-VENC)");
    switch(enType)
    {
        case PT_H265:
            gs_stPara.bThreadStart = HI_TRUE;
            gs_stPara.s32Cnt = 1;
            gs_stPara.VeChn[0] = 0;
            memset(gs_stPara.path,0,50);
            memcpy(gs_stPara.path,path,strlen(path));//设置路径
            gs_stPara.width = stSize.u32Width;
            gs_stPara.height = stSize.u32Height;
            pthread_create(&gs_VencPid, 0, ffmpegEncodeFile, (HI_VOID*)&gs_stPara);//开启录像进程
        break;
        case PT_JPEG:
            mppVencJpeg(0, 1,path);
        break;
        default:
        break;
    }
    return HI_SUCCESS;
}
#endif

//=======================================================================================================
// 编码测试,
//=======================================================================================================
HI_S32 mppVencStart(PAYLOAD_TYPE_E enType, SIZE_S stSize,HI_U32 u32FrameRate,VPSS_CHN VpssChn, 
             VENC_CHN VencChn, HI_U32 u32Profile, HI_BOOL bRcnRefShareBuf,VENC_GOP_ATTR_S *pstGopAttr,char *path)
{
    VENC_RECV_PIC_PARAM_S  stRecvParam;
    VENC_CHN_ATTR_S        stVencChnAttr;
    VENC_ATTR_JPEG_S       stJpegAttr;
    VENC_H265_FIXQP_S      stH265FixQp;
    VENC_MJPEG_FIXQP_S     stMjpegeFixQp;
    MPP_CHN_S stSrcChn;
    MPP_CHN_S stDestChn;

    HI_U32                 u32StatTime  = 1;
    HI_U32                 u32Gop       = 30;   // gop 值。取值范围： [1, 65536]
    SAMPLE_RC_E            enRcMode;     

    /******************************************
     step 1:  Create Venc Channel
    ******************************************/
    stVencChnAttr.stVencAttr.enType          = enType;
    stVencChnAttr.stVencAttr.u32MaxPicWidth  = stSize.u32Width;
    stVencChnAttr.stVencAttr.u32MaxPicHeight = stSize.u32Height;
    stVencChnAttr.stVencAttr.u32PicWidth     = stSize.u32Width;/*the picture width*/
    stVencChnAttr.stVencAttr.u32PicHeight    = stSize.u32Height;/*the picture height*/
    stVencChnAttr.stVencAttr.u32BufSize      = stSize.u32Width * stSize.u32Height * 2;/*stream buffer size*/
    stVencChnAttr.stVencAttr.u32Profile      = u32Profile;
    stVencChnAttr.stVencAttr.bByFrame        = HI_TRUE;
    
    switch (enType)
    {
        //--------------------------------------------------------------------------------------------------------------------
        //    H265
        //--------------------------------------------------------------------------------------------------------------------
        case PT_H265://H265视频的参数设置
        {

            enRcMode = SAMPLE_RC_FIXQP;         //改变此参数以确定不同的 H265 编码模式,

            if (SAMPLE_RC_CBR == enRcMode)
            {
                VENC_H265_CBR_S    stH265Cbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265CBR;
                stH265Cbr.u32Gop                = u32Gop;
                stH265Cbr.u32StatTime           = u32StatTime;      //stream rate statics time(s) 
                stH265Cbr.u32SrcFrameRate       = u32FrameRate;     //input (vi) frame rate 
                stH265Cbr.fr32DstFrameRate      = u32FrameRate;     //target frame rate 

                //stH265Cbr.u32BitRate          = 1024 * 2 + 2048*u32FrameRate/30;      //设置码率 1080P               
                stH265Cbr.u32BitRate            = 1024 * 15 + 2048*u32FrameRate/30;     //default
                //stH265Cbr.u32BitRate          = 1024 * 2 + 1024*u32FrameRate/30;      //PIC_720P
                //stH265Cbr.u32BitRate          = 1024 * 2 + 2048*u32FrameRate/30;      //PIC_1080P
                //stH265Cbr.u32BitRate          = 1024 * 3 + 3072*u32FrameRate/30;      //PIC_2592x1944
                //stH265Cbr.u32BitRate          = 1024 * 5 + 5120*u32FrameRate/30;      //PIC_3840x2160

                memcpy(&stVencChnAttr.stRcAttr.stH265Cbr, &stH265Cbr, sizeof(VENC_H265_CBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_FIXQP == enRcMode)
            {
                VENC_H265_FIXQP_S    stH265FixQp;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265FIXQP;
                stH265FixQp.u32Gop              = 30;
                stH265FixQp.u32SrcFrameRate     = u32FrameRate;
                stH265FixQp.fr32DstFrameRate    = u32FrameRate;
                stH265FixQp.u32IQp              = 25;
                stH265FixQp.u32PQp              = 30;
                stH265FixQp.u32BQp              = 32;

                memcpy(&stVencChnAttr.stRcAttr.stH265FixQp, &stH265FixQp, sizeof(VENC_H265_FIXQP_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_VBR == enRcMode)
            {
                VENC_H265_VBR_S    stH265Vbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265VBR;
                stH265Vbr.u32Gop                = u32Gop;
                stH265Vbr.u32StatTime           = u32StatTime;
                stH265Vbr.u32SrcFrameRate       = u32FrameRate;
                stH265Vbr.fr32DstFrameRate      = u32FrameRate;

                //stH265Vbr.u32MaxBitRate       = 1024 * 2 + 2048*u32FrameRate/30;      //设置码率 1080P   
                stH265Vbr.u32MaxBitRate         = 1024 * 15+ 2048*u32FrameRate/30;      //default

                memcpy(&stVencChnAttr.stRcAttr.stH265Vbr, &stH265Vbr, sizeof(VENC_H265_VBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if(SAMPLE_RC_AVBR == enRcMode)
            {
                VENC_H265_AVBR_S    stH265AVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265AVBR;
                stH265AVbr.u32Gop               = u32Gop;
                stH265AVbr.u32StatTime          = u32StatTime;
                stH265AVbr.u32SrcFrameRate      = u32FrameRate;
                stH265AVbr.fr32DstFrameRate     = u32FrameRate;

                //stH265AVbr.u32MaxBitRate        = 1024 * 2 + 2048*u32FrameRate/30;    //设置码率 1080P  
                stH265AVbr.u32MaxBitRate        = 1024 * 15+ 2048*u32FrameRate/30;      //default

                memcpy(&stVencChnAttr.stRcAttr.stH265AVbr, &stH265AVbr, sizeof(VENC_H265_AVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if(SAMPLE_RC_QVBR == enRcMode)
            {
                VENC_H265_QVBR_S    stH265QVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265QVBR;
                stH265QVbr.u32Gop               = u32Gop;
                stH265QVbr.u32StatTime          = u32StatTime;
                stH265QVbr.u32SrcFrameRate      = u32FrameRate;
                stH265QVbr.fr32DstFrameRate     = u32FrameRate;

                //stH265QVbr.u32TargetBitRate   = 1024 * 2 + 2048*u32FrameRate/30;      //设置码率 1080P 
                stH265QVbr.u32TargetBitRate     = 1024 * 15+ 2048*u32FrameRate/30;      //default

                memcpy(&stVencChnAttr.stRcAttr.stH265QVbr, &stH265QVbr, sizeof(VENC_H265_QVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if(SAMPLE_RC_CVBR == enRcMode)
            {
                VENC_H265_CVBR_S    stH265CVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265CVBR;
                stH265CVbr.u32Gop               = u32Gop;
                stH265CVbr.u32StatTime          = u32StatTime;
                stH265CVbr.u32SrcFrameRate      = u32FrameRate;
                stH265CVbr.fr32DstFrameRate     = u32FrameRate;
                stH265CVbr.u32LongTermStatTime  = 1;
                stH265CVbr.u32ShortTermStatTime = u32StatTime;

                stH265CVbr.u32MaxBitRate         = 1024 * 24  + 5120*u32FrameRate/30;
                stH265CVbr.u32LongTermMaxBitrate = 1024 * 15  + 2048*u32FrameRate/30;
                stH265CVbr.u32LongTermMinBitrate = 1024*5;                                  //default

                //stH265CVbr.u32MaxBitRate         = 1024 * 2 + 2048*u32FrameRate/30;
                //stH265CVbr.u32LongTermMaxBitrate = 1024 * 2 + 2048*u32FrameRate/30;
                //stH265CVbr.u32LongTermMinBitrate = 1024;                                  //1080P

                //stH265CVbr.u32MaxBitRate         = 1024 * 4 + 3072*u32FrameRate/30;
                //stH265CVbr.u32LongTermMaxBitrate = 1024 * 3 + 3072*u32FrameRate/30;
                //stH265CVbr.u32LongTermMinBitrate = 1024*2;                                //PIC_2592x1944

                //stH265CVbr.u32MaxBitRate         = 1024 * 8  + 5120*u32FrameRate/30;
                //stH265CVbr.u32LongTermMaxBitrate = 1024 * 5  + 5120*u32FrameRate/30;
                //stH265CVbr.u32LongTermMinBitrate = 1024*3;                                //PIC_3840x2160              

                memcpy(&stVencChnAttr.stRcAttr.stH265CVbr, &stH265CVbr, sizeof(VENC_H265_CVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if(SAMPLE_RC_QPMAP == enRcMode)
            {
                VENC_H265_QPMAP_S    stH265QpMap;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H265QPMAP;
                stH265QpMap.u32Gop           = u32Gop;
                stH265QpMap.u32StatTime      = u32StatTime;
                stH265QpMap.u32SrcFrameRate  = u32FrameRate;
                stH265QpMap.fr32DstFrameRate = u32FrameRate;
                stH265QpMap.enQpMapMode      = VENC_RC_QPMAP_MODE_MEANQP;
                memcpy(&stVencChnAttr.stRcAttr.stH265QpMap, &stH265QpMap, sizeof(VENC_H265_QPMAP_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
        }
        break;

        //--------------------------------------------------------------------------------------------------------------------
        //    H264
        //--------------------------------------------------------------------------------------------------------------------
        case PT_H264:
        {
            enRcMode = VENC_H264_VBR_S;                         //改变此参数以确定不同的 H265 编码模式,

            if (SAMPLE_RC_CBR == enRcMode)
            {
                VENC_H264_CBR_S    stH264Cbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264CBR;
                stH264Cbr.u32Gop                = u32Gop; 
                stH264Cbr.u32StatTime           = u32StatTime; 
                stH264Cbr.u32SrcFrameRate       = u32FrameRate; 
                stH264Cbr.fr32DstFrameRate      = u32FrameRate; 

                //u32BitRate  输出码率 以 kbps 为单位。取值范围：[2,51200] 
                stH264Cbr.u32BitRate            = 1024 * 24  + 5120*u32FrameRate/30;  //PIC_7680x4320  8K=default   

                //stH264Cbr.u32BitRate            = 1024 * 3 + 1024*u32FrameRate/30;  //PIC_720P
                //stH264Cbr.u32BitRate            = 1024 * 2 + 2048*u32FrameRate/30;  //PIC_1080P
                //stH264Cbr.u32BitRate            = 1024 * 4 + 3072*u32FrameRate/30;  //PIC_2592x1944
                //stH264Cbr.u32BitRate            = 1024 * 8 + 5120*u32FrameRate/30;  //PIC_3840x2160      4K
                //stH264Cbr.u32BitRate            = 1024 * 24+ 5120*u32FrameRate/30;  //PIC_7680x4320      8K=default 

                memcpy(&stVencChnAttr.stRcAttr.stH264Cbr, &stH264Cbr, sizeof(VENC_H264_CBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_FIXQP == enRcMode)
            {
                VENC_H264_FIXQP_S    stH264FixQp;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264FIXQP;
                stH264FixQp.u32Gop           = 30;
                stH264FixQp.u32SrcFrameRate  = u32FrameRate;
                stH264FixQp.fr32DstFrameRate = u32FrameRate;
                stH264FixQp.u32IQp           = 25;  //I 帧所有宏块 Qp 值。取值范围： [0, 51]
                stH264FixQp.u32PQp           = 30;  //P 帧所有宏块 Qp 值。取值范围： [0, 51]
                stH264FixQp.u32BQp           = 32;  //B 帧所有宏块 Qp 值。取值范围： [0, 51]
                memcpy(&stVencChnAttr.stRcAttr.stH264FixQp, &stH264FixQp, sizeof(VENC_H264_FIXQP_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_VBR == enRcMode)
            {
                VENC_H264_VBR_S    stH264Vbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264VBR;
                stH264Vbr.u32Gop           = u32Gop;
                stH264Vbr.u32StatTime      = u32StatTime;
                stH264Vbr.u32SrcFrameRate  = u32FrameRate;
                stH264Vbr.fr32DstFrameRate = u32FrameRate;
                
                //u32MaxBitRate  最大码率 以 kbps 为单位。取值范围：[2,51200] 
                stH264Vbr.u32MaxBitRate    = 1024 * 15  + 2048*u32FrameRate/30;     //default

                //stH264Vbr.u32MaxBitRate = 1024 * 2   + 1024*u32FrameRate/30;      //PIC_720P  
                //stH264Vbr.u32MaxBitRate = 1024 * 2   + 2048*u32FrameRate/30;      //PIC_1080P
                //stH264Vbr.u32MaxBitRate = 1024 * 3   + 3072*u32FrameRate/30;      //PIC_2592x1944
                //stH264Vbr.u32MaxBitRate = 1024 * 5   + 5120*u32FrameRate/30;      //PIC_3840x2160    4K
                //stH264Vbr.u32MaxBitRate = 1024 * 20  + 5120*u32FrameRate/30;      //PIC_7680x4320    8K

                memcpy(&stVencChnAttr.stRcAttr.stH264Vbr, &stH264Vbr, sizeof(VENC_H264_VBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_AVBR == enRcMode)
            {
                VENC_H264_AVBR_S    stH264AVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264AVBR;
                stH264AVbr.u32Gop           = u32Gop;
                stH264AVbr.u32StatTime      = u32StatTime;
                stH264AVbr.u32SrcFrameRate  = u32FrameRate;
                stH264AVbr.fr32DstFrameRate = u32FrameRate;
 
                //u32MaxBitRate  最大码率 以 kbps 为单位。取值范围：[2,51200]
                stH264AVbr.u32MaxBitRate    = 1024 * 15  + 2048*u32FrameRate/30;     //default
                
                //stH264AVbr.u32MaxBitRate  = 1024 * 2   + 1024*u32FrameRate/30;     //PIC_720P
                //stH264AVbr.u32MaxBitRate  = 1024 * 2   + 2048*u32FrameRate/30;     //PIC_1080P
                //stH264AVbr.u32MaxBitRate  = 1024 * 3   + 3072*u32FrameRate/30;     //PIC_2592x1944
                //stH264AVbr.u32MaxBitRate  = 1024 * 5   + 5120*u32FrameRate/30;     //PIC_3840x2160
                //stH264AVbr.u32MaxBitRate  = 1024 * 20  + 5120*u32FrameRate/30;     //PIC_7680x4320

                memcpy(&stVencChnAttr.stRcAttr.stH264AVbr, &stH264AVbr, sizeof(VENC_H264_AVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if (SAMPLE_RC_QVBR == enRcMode)
            {
                VENC_H264_QVBR_S    stH264QVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264QVBR;
                stH264QVbr.u32Gop           = u32Gop;
                stH264QVbr.u32StatTime      = u32StatTime;
                stH264QVbr.u32SrcFrameRate  = u32FrameRate;
                stH264QVbr.fr32DstFrameRate = u32FrameRate;

                //u32MaxBitRate  最大码率 以 kbps 为单位。取值范围：[2,51200]
                stH264QVbr.u32TargetBitRate   = 1024 * 15  + 2048*u32FrameRate/30;      //default
                //stH264QVbr.u32TargetBitRate = 1024 * 2   + 1024*u32FrameRate/30;      //PIC_720P
                //stH264QVbr.u32TargetBitRate = 1024 * 2   + 2048*u32FrameRate/30;      //PIC_1080P
                //stH264QVbr.u32TargetBitRate = 1024 * 5   + 5120*u32FrameRate/30;      //PIC_3840x2160
                //stH264QVbr.u32TargetBitRate = 1024 * 20  + 5120*u32FrameRate/30;      //PIC_7680x4320

                memcpy(&stVencChnAttr.stRcAttr.stH264QVbr, &stH264QVbr, sizeof(VENC_H264_QVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
            else if(SAMPLE_RC_CVBR == enRcMode)
            {
                VENC_H264_CVBR_S    stH264CVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264CVBR;
                stH264CVbr.u32Gop               = u32Gop;
                stH264CVbr.u32StatTime          = u32StatTime;
                stH264CVbr.u32SrcFrameRate      = u32FrameRate;
                stH264CVbr.fr32DstFrameRate     = u32FrameRate;
                stH264CVbr.u32LongTermStatTime  = 1;
                stH264CVbr.u32ShortTermStatTime = u32StatTime;
                        

                stH264CVbr.u32MaxBitRate         = 1024 * 24  + 5120*u32FrameRate/30;
                stH264CVbr.u32LongTermMaxBitrate = 1024 * 15 + 2048*u32FrameRate/30;
                stH264CVbr.u32LongTermMinBitrate = 1024*5;                                  //default

                //PIC_720P
                //stH264CVbr.u32MaxBitRate         = 1024 * 24  + 5120*u32FrameRate/30;
                //stH264CVbr.u32LongTermMaxBitrate = 1024 * 15 + 2048*u32FrameRate/30;
                //stH264CVbr.u32LongTermMinBitrate = 1024*5;                                
                
                //PIC_1080P
                //stH264CVbr.u32MaxBitRate         = 1024 * 2 + 2048*u32FrameRate/30;
                //stH264CVbr.u32LongTermMaxBitrate = 1024 * 2 + 2048*u32FrameRate/30;
                //stH264CVbr.u32LongTermMinBitrate = 1024;                                  

                //PIC_3840x2160:
                //stH264CVbr.u32MaxBitRate         = 1024 * 8  + 5120*u32FrameRate/30;
                //stH264CVbr.u32LongTermMaxBitrate = 1024 * 5  + 5120*u32FrameRate/30;
                //stH264CVbr.u32LongTermMinBitrate = 1024*3;

                //PIC_7680x4320:
                //stH264CVbr.u32MaxBitRate         = 1024 * 24  + 5120*u32FrameRate/30;
                //stH264CVbr.u32LongTermMaxBitrate = 1024 * 20 + 5120*u32FrameRate/30;
                //stH264CVbr.u32LongTermMinBitrate = 1024*6;

                memcpy(&stVencChnAttr.stRcAttr.stH264CVbr, &stH264CVbr, sizeof(VENC_H264_CVBR_S));
                stVencChnAttr.stVencAttr.stAttrH265e.bRcnRefShareBuf = bRcnRefShareBuf;
                memcpy(&stVencChnAttr.stGopAttr,pstGopAttr,sizeof(VENC_GOP_ATTR_S));
            }
        }
        break;


        //--------------------------------------------------------------------------------------------------------------------
        //   M-JPEG
        //--------------------------------------------------------------------------------------------------------------------
        case PT_MJPEG:
        {

            enRcMode = SAMPLE_RC_CBR;               //改变此参数以确定不同的 H265 编码模式,

            if (SAMPLE_RC_FIXQP == enRcMode)
            {
                VENC_MJPEG_FIXQP_S stMjpegeFixQp;   //固定Qp值

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_MJPEGFIXQP;
                stMjpegeFixQp.u32Qfactor        = 95;                       //Range:[1,99];image quality.
                stMjpegeFixQp.u32SrcFrameRate   = u32FrameRate;
                stMjpegeFixQp.fr32DstFrameRate  = u32FrameRate;

                memcpy(&stVencChnAttr.stRcAttr.stMjpegFixQp, &stMjpegeFixQp,sizeof(VENC_MJPEG_FIXQP_S));
                stVencChnAttr.stGopAttr.enGopMode   = VENC_GOPMODE_NORMALP;
                stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta = 0;
            }
            else if (SAMPLE_RC_CBR == enRcMode)     //CBR 恒定比特率
            {
                VENC_MJPEG_CBR_S stMjpegeCbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_MJPEGCBR;
                stMjpegeCbr.u32StatTime         = u32StatTime;
                stMjpegeCbr.u32SrcFrameRate     = u32FrameRate;
                stMjpegeCbr.fr32DstFrameRate    = u32FrameRate;

                //stMjpegeCbr.u32BitRate 平均 bitrate，以 kbps 为单位,取值范围：[2,102400]   最大100Mb=12.5MB每秒
                stMjpegeCbr.u32BitRate          = 1024 * 20 + 2048*u32FrameRate/30;     //default
                //stMjpegeCbr.u32BitRate        = 1024 * 5  + 1024*u32FrameRate/30;     //PIC_720P
                //stMjpegeCbr.u32BitRate        = 1024 * 8  + 2048*u32FrameRate/30;     //PIC_1080P
                //stMjpegeCbr.u32BitRate        = 1024 * 25 + 5120*u32FrameRate/30;     //PIC_3840x2160
                //stMjpegeCbr.u32BitRate        = 1024 * 40 + 5120*u32FrameRate/30;     //PIC_7680x4320

                memcpy(&stVencChnAttr.stRcAttr.stMjpegCbr, &stMjpegeCbr,sizeof(VENC_MJPEG_CBR_S));
                stVencChnAttr.stGopAttr.enGopMode               = VENC_GOPMODE_NORMALP;//VENC_GOPMODE_DUALP;  //VENC_GOPMODE_SMARTP;
                stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta  = 0;

            }
            else if (SAMPLE_RC_VBR == enRcMode)     //VBR 动态比特率
            {
                VENC_MJPEG_VBR_S   stMjpegVbr;

                stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_MJPEGVBR;
                stMjpegVbr.u32StatTime          = u32StatTime;          //VBR 码率统计时间， 以秒为单位。取值范围： [1, 60]。
                stMjpegVbr.u32SrcFrameRate      = u32FrameRate;         //编码器输入帧率，以 fps 为单位, 取值范围： [1, 240]
                stMjpegVbr.fr32DstFrameRate     = 5;                    //编码器输出帧率，以 fps 为单位。 取值范围： [1/64, u32SrcFrmRate]。

                //u32MaxBitRate = 最大 bitrate， 以 kbps 为单位。取值范围：[2,102400] 
                stMjpegVbr.u32MaxBitRate        = 1024 * 20 + 2048*u32FrameRate/30;         //default
                //stMjpegVbr.u32MaxBitRate      = 1024 * 5 + 1024*u32FrameRate/30;          //PIC_720P
                //stMjpegVbr.u32MaxBitRate      = 1024 * 8 + 2048*u32FrameRate/30;          //PIC_1080P
                //stMjpegVbr.u32MaxBitRate      = 1024 * 25 + 5120*u32FrameRate/30;         //PIC_3840x2160
                //stMjpegVbr.u32MaxBitRate      = 1024 * 40 + 5120*u32FrameRate/30;         //PIC_7680x4320

                memcpy(&stVencChnAttr.stRcAttr.stMjpegVbr, &stMjpegVbr,sizeof(VENC_MJPEG_VBR_S));
                stVencChnAttr.stGopAttr.enGopMode               = VENC_GOPMODE_NORMALP;//VENC_GOPMODE_DUALP;  //VENC_GOPMODE_SMARTP;
                stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta  = 0;
            }
        }
        break;

        //--------------------------------------------------------------------------------------------------------------------
        //   JPEG
        //--------------------------------------------------------------------------------------------------------------------
        case PT_JPEG:
            stJpegAttr.bSupportDCF                              = HI_FALSE;
            stJpegAttr.stMPFCfg.u8LargeThumbNailNum             = 0;
            stJpegAttr.enReceiveMode                            = VENC_PIC_RECEIVE_SINGLE;
            memcpy(&stVencChnAttr.stVencAttr.stAttrJpege, &stJpegAttr, sizeof(VENC_ATTR_JPEG_S));
            stVencChnAttr.stGopAttr.enGopMode                   = VENC_GOPMODE_NORMALP;//VENC_GOPMODE_DUALP;  //VENC_GOPMODE_SMARTP;
            stVencChnAttr.stGopAttr.stNormalP.s32IPQpDelta      = 0;
            break;

        default:
            break;
    }

    CHECK_RET(HI_MPI_VENC_CreateChn(VencChn, &stVencChnAttr), "HI_MPI_VENC_CreateChn()");
    stRecvParam.s32RecvPicNum = -1;
    CHECK_RET(HI_MPI_VENC_StartRecvFrame(VencChn,&stRecvParam), "HI_MPI_VENC_StartRecvFrame()");
    stSrcChn.enModId    = HI_ID_VPSS;
    stSrcChn.s32DevId   = 0;
    stSrcChn.s32ChnId   = VpssChn;
    stDestChn.enModId   = HI_ID_VENC;
    stDestChn.s32DevId  = 0;
    stDestChn.s32ChnId  = VencChn;
    CHECK_RET(HI_MPI_SYS_Bind(&stSrcChn, &stDestChn), "HI_MPI_SYS_Bind(VPSS-VENC)");
    switch(enType)
    {
        case PT_H265:
            gs_stPara.bThreadStart = HI_TRUE;
            gs_stPara.s32Cnt = 1;
            gs_stPara.VeChn[0] = 0;
            memset(gs_stPara.path,0,50);
            memcpy(gs_stPara.path,path,strlen(path));//设置路径
            gs_stPara.width = stSize.u32Width;
            gs_stPara.height = stSize.u32Height;
            pthread_create(&gs_VencPid, 0, ffmpegEncodeFile, (HI_VOID*)&gs_stPara);//开启录像进程
        break;
        case PT_JPEG:
            mppVencJpeg(0, 1,path);
        break;
        default:
        break;
    }
    return HI_SUCCESS;
}





//=======================================================================================================
//停止VENC的功能
HI_S32 mppVencStop(VPSS_CHN VpssChn)
{
    MPP_CHN_S stSrcChn;
    MPP_CHN_S stDestChn;
    if (HI_TRUE == gs_stPara.bThreadStart)
    {
        gs_stPara.bThreadStart = HI_FALSE;
        pthread_join(gs_VencPid, 0);
    }
    stSrcChn.enModId   = HI_ID_VPSS;
    stSrcChn.s32DevId  = 0;
    stSrcChn.s32ChnId  = VpssChn;
    stDestChn.enModId  = HI_ID_VENC;
    stDestChn.s32DevId = 0;
    stDestChn.s32ChnId = 0;
    CHECK_RET(HI_MPI_SYS_UnBind(&stSrcChn, &stDestChn), "HI_MPI_SYS_UnBind(VPSS-VENC)");
    CHECK_RET(HI_MPI_VENC_StopRecvFrame(0), "HI_MPI_VENC_StopRecvFrame()");
    CHECK_RET(HI_MPI_VENC_DestroyChn(0), "HI_MPI_VENC_DestroyChn()");
    return HI_SUCCESS;
}
int framew = 0;
int frameh = 0;

//=======================================================================================================
//解码视频文件avi，使其变成H265文件可以直接播放
int mppVdecDecode(char *filename)
{
    char * vidbuf = (char *)malloc(327680);
    long framesize;
    avi_t *avifile;
    int frame;
    int frames;
    double framerate = 0.0f;
    FILE* pFile;
    avifile = AVI_open_input_file(filename, 1); //打开源文件
    if(avifile == NULL)
    {
        printf("open error \n");
        return -1;
    }
    frames = AVI_video_frames(avifile);
    framew = AVI_video_width(avifile);//获取视频长宽
    frameh = AVI_video_height(avifile);
    pFile = fopen(h265Path, "wb");
    decodeFrame = 0;
    totalFrame = frames;
    decodeFlag = 1;
    printf("w:%d,h:%d,frames:%d,file:%s\n",framew,frameh,frames,h265Path);
    AVI_seek_start( avifile ); //寻找文件开始
    for (frame = 0; frame < frames;frame++)//read and write avi per fream
    {
        decodeFrame = frame;
        AVI_set_video_position(avifile, frame);//将avi文件移动到第fream帧
        AVI_read_frame(avifile,(char *)vidbuf);//read fream set video into vidbuf
        fwrite(vidbuf,AVI_frame_size(avifile, frame), 1, pFile);
        fflush(pFile);
    }
    AVI_close(avifile);
    fclose(pFile);
    decodeFlag = 0;
}


//=======================================================================================================
void dbg_time(int flag)
{
    struct timespec time = {0, 0};
    static long t1_sec,t1_nsec,t2_sec,t2_nsec,t;
    clock_gettime(CLOCK_REALTIME, &time);
    t2_sec = t1_sec;
    t2_nsec = t1_nsec;
    t1_sec = time.tv_sec;
    t1_nsec = time.tv_nsec;
    t = (t1_sec-t2_sec)*1000000000 + t1_nsec - t2_nsec;
    printf("frame:%d,  %lu  ns\n",flag, t);
}

//=======================================================================================================
//mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,
//void mppClean(int mode,unsigned char *fbp,int immediate)// 刷新 freambuffer    显示的freambuffer

camer_ops :: camer_ops(void)
{
    int fd;
    fd = open("/dev/fb0", O_RDWR, 0);   //打开framebuffer
    fbp = (unsigned char *)mmap(0, 1920*1080*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);  //映射framebuffer到fbp上

    frameSettingInit();                 //设置遮罩和尺寸参数
    configInit(sensorId,displayId);     //初始化屏幕和摄像头(VI&VO)
    mppOsdInfoUpdate();                 //手动更新OSD，第一次启动会初始化

    mppClean(1,fbp,1);    //mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,
    //mppClean(0,fbp,1);  //mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,

    Phototimeer = new QTimer(this);
    connect(Phototimeer, SIGNAL(timeout()), this, SLOT(closeSavephoto()));      //用于拍照计时
	osdtimer = new QTimer(this);
    connect(osdtimer, SIGNAL(timeout()), this, SLOT(osdupdate()));              //用OSD更新，0.5秒一次
	osdtimer->start(500);
}



//=======================================================================================================
//0 bat 1 sd 2 photo 3-4:month 5-6:day
void camer_ops ::osdupdate()
{
    mppOsdInfoUpdate();
}



//=======================================================================================================
void camer_ops ::closeSavephoto()
{
    photo = 0;
    Phototimeer->stop();
}


//=======================================================================================================
//拍照函数
//=======================================================================================================
void camer_ops::save_photo_slot(char * path)
{
    HI_U32             u32Profile = 0;
    HI_BOOL            bRcnRefShareBuf = HI_TRUE;
    VENC_GOP_ATTR_S    stGopAttr;
    SIZE_S stVencSize;
    if(frame == 0)
    {
        stVencSize.u32Width   = 800;              //displaywidth;
        stVencSize.u32Height  = 800;              //displayheight; 目前尺寸是800X800，有需要的时候可以修改
        mppVencStart(PT_JPEG,stVencSize,30,VpssChn,0,u32Profile,bRcnRefShareBuf,&stGopAttr,path);
        printf("path:%s\n",path);
        mppVencStop(VpssChn);
        if(!Phototimeer->isActive())
        {
            photo = 1;                          //显示拍照完成标志位置于1
            Phototimeer->start(1200);
        }
    }
}

//=======================================================================================================
//录像函数
//=======================================================================================================
void camer_ops::save_video_slot(char * path)
{
    HI_U32              u32Profile = 0;
    HI_BOOL             bRcnRefShareBuf = HI_TRUE;
    VENC_GOP_ATTR_S     stGopAttr;
    SIZE_S              stVencSize;
    stVencSize.u32Width  = displaywidth;
    stVencSize.u32Height = displayheight;
    save_video = !save_video;
    printf("save:%d\n",save_video);

    if( (frame == 0) || (record == 1) )
    {
        if(save_video)
        {
            record = 1;
            printf("pathvideo:%s\n",path);
            stGopAttr.enGopMode  = VENC_GOPMODE_NORMALP;
            stGopAttr.stNormalP.s32IPQpDelta = 2;
            mppVencStart(PT_H265,stVencSize,30,VpssChn,0,u32Profile,bRcnRefShareBuf,&stGopAttr,path);
        }
        else
        {
            record = 0;
            mppVencStop(VpssChn);
        }
    }
}

//=======================================================================================================
//HDMI插入时转换显示的函数
//=======================================================================================================
void camer_ops::displayChange(int hdmi)
{

    static int full_tmp = 1;
    configInit(sensorId,!hdmi);                                                     //初始化HDMI设备
    viVpssDeinit();                                                                 //将现有的Vi和VPSS销毁
    mppDisplayResize(stViConfig,stVoConfig,displaywidth,displayheight);             //VIVPSS初始化和重启VO

    //full 0=toolbar, 1=full, 2=play  3=no video, 4=hdmi,
    if(hdmi)                // HDMI插入检测到信号hdmi=1时,mppClean刷新模式为4
    {
        full_tmp = full;    //int full = 1;
        full = 4;           //fbp刷新模式调整为hdmi模式
    }
    else                    //mppClean刷新模式为1
        full = full_tmp;
}

//=======================================================================================================
//画面冻结函数
//=======================================================================================================
void camer_ops::video_freezz_frame(int state)
{
    if(state)
        video_freeze_state = 1;     //改变冻结标志位
    else
        video_freeze_state = 0;
}


void camer_ops::showpicfSet_status(bool i)
{
    is_show = i;
}


camer_ops :: ~camer_ops(void)
{
    SAMPLE_COMM_VO_StopVO(&stVoConfig);
    SAMPLE_COMM_VI_StopVi(&stViConfig);
}


//=======================================================================================================
//主进程
//=======================================================================================================
void camer_ops :: run()
{
    int showFlag = 0;
    int frame_prv = 0;
    char mesg[100];
    int vdencFlag = 0;

    VDEC_THREAD_PARAM_S     stVdecSend[VDEC_MAX_CHN_NUM];
    pthread_t               VdecThread[2*VDEC_MAX_CHN_NUM];
    VIDEO_FRAME_INFO_S      stFrameInfom;;

    viVpssDeinit();

    while(1)
    {
        if(is_show)
        {
            if(showFlag == 0)
            {
                showFlag = 1;
                viVpssInit(stViConfig,displaywidth,displayheight);      //没有显示的时候先初始化vivpss
                //mppDisplayResize(stViConfig,stVoConfig,displaywidth,displayheight);
            }
            frame =  mppFrameGet(VpssChn,0,&stFrameInfom);              //从vpss里获取图像
            if((frame_prv !=0)&&(frame==0))                             //没有获取到图像时初始化ov426确保接上摄像头时就能显示图像
                system("sh /usr/qt5.12/demos/sensor_rst.sh >/dev/null");
            frame_prv = frame;

            if(is_show)
            {
               mppClean(full,fbp,0);      //显示fbp   //mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,
            }

            if(frame == 0 && !video_freeze_state)
            {
                mppFramePut(VpssChn,0,photo,&stFrameInfom);             //没有冻结的时候正常输出图像
                is_cameraopen = true;
            }

            else if(frame == 0 && video_freeze_state){
                HI_MPI_VPSS_ReleaseChnFrame(VpssChn,0,&stFrameInfom);   //冻结的时候直接释放通道
            }
        }
        else
        {
            if(showFlag == 1)
            {
                showFlag = 0;
                viVpssDeinit();
                is_cameraopen = false;
            }
        }

        if(startPlayAvi)//播放视频
        {
            if(vdencFlag == 0)//解码过程
            {
                if(mppVdecDecode(videoPath)<0)
                {
                    startPlayAvi = 0;
                    continue;
                }
                vdencFlag = 1;
                char *ptr[4];
                char *p;
                int length = 0;
                vdencVpssInit(framew,frameh);
                sprintf(mesg,"rm %s -f",h265Path);
                ptr[length] = strtok_r(h265Path,"/",&p);
                while(ptr[length] != NULL)
                {
                    length++;
                    ptr[length] = strtok_r(NULL,"/",&p);
                }
                switch(length)
                {
                    case 2:
                    snprintf(stVdecSend[0].cFilePath, sizeof(stVdecSend[0].cFilePath), "/%s",ptr[0]);
                    snprintf(stVdecSend[0].cFileName, sizeof(stVdecSend[0].cFileName), "%s",ptr[1]);
                    break;
                    case 3:
                    snprintf(stVdecSend[0].cFilePath, sizeof(stVdecSend[0].cFilePath), "/%s/%s",ptr[0],ptr[1]);
                    snprintf(stVdecSend[0].cFileName, sizeof(stVdecSend[0].cFileName), "%s",ptr[2]);
                    break;
                }
                //snprintf(stVdecSend[0].cFileName, sizeof(stVdecSend[0].cFileName), "%s",strtok(videoPath,"video/"));
                //snprintf(stVdecSend[0].cFilePath, sizeof(stVdecSend[0].cFilePath), "/%s",strtok(videoPath,"/"));
                printf("play path:%s,play file %s\n",stVdecSend[0].cFilePath,stVdecSend[0].cFileName);
                stVdecSend[0].enType          = PT_H265;
                stVdecSend[0].s32StreamMode   = VIDEO_MODE_FRAME;
                stVdecSend[0].s32ChnId        = 0;
                stVdecSend[0].s32IntervalTime = 20000;
                stVdecSend[0].u64PtsInit      = 0;
                stVdecSend[0].u64PtsIncrease  = 0;
                stVdecSend[0].eThreadCtrl     = THREAD_CTRL_START;
                stVdecSend[0].bCircleSend     = HI_FALSE;
                stVdecSend[0].s32MilliSec     = 0;
                stVdecSend[0].s32MinBufSize   = (1920 * 1080 * 3)>>1;
                SAMPLE_COMM_VDEC_StartSendStream(1, &stVdecSend[0], &VdecThread[0]);//开始播放
                mppClean(2,fbp,1);  //mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,[mode=2 视频解码过程时不显示摄像头图像]
            }
            else
            {
                if(pausePlayAvi)
                {
                    stVdecSend[0].eThreadCtrl = THREAD_CTRL_PAUSE;//设置进程暂停
                }
                else
                {
                    stVdecSend[0].eThreadCtrl = THREAD_CTRL_START;//视频重播
                    mppClean(2,fbp,0);//mode0=toolbar, mode1=full, mode2=play  mode3=no video, mode4=hdmi,[mode=2 播放视频时不显示摄像头图像]
                }

            }
        }
        else  //没有播放视频
        {
            playFlag = 0;
            if(vdencFlag == 1)
            {
                vdencFlag = 0;
                SAMPLE_COMM_VDEC_StopSendStream(1, &stVdecSend[0], &VdecThread[0]);
                vdencVpssDeinit();
                system(mesg);
            }
        }
	}
}
